overflow
JavaScript syntax:
overflow
Values:
visible | hidden | scroll | auto | inherit
Initial value:
visible
Applies to:
Block-level and replaced elements.
Inherited:
No.
Description:
overflow defines what to do during overflow.
Examples:
<script language="JavaScript">
function fn1() {
if (myBody.style.overflow == "auto") {
myBody.style.overflow = "scroll";
myButton.value = "Set overflow to hidden.";
results.innerText = "overflow is set to scroll.";
return false;
}
if (myBody.style.overflow == "scroll") {
myBody.style.overflow = "hidden";
myButton.value = "Set overflow to auto";
results.innerText = "overflow is set to hidden.";
return false;
}
if (myBody.style.overflow == "hidden") {
myBody.style.overflow = "auto";
myButton.value = "Set overflow to scroll";
results.innerText = "overflow is set to auto.";
return false;
}
}
</script>
<body id="myBody" bottommargin="150" style="overflow: auto">
<div id="results" style="color: red">overflow is set to auto.</div>
<br>
<input id=myButton type=button value="Set overflow to scroll"
onclick="fn1();">
Home
HTML CSS Book
CSS Reference
HTML CSS Book
CSS Reference
Property:
- background
- background-attachment
- background-color
- background-image
- background-position
- background-repeat
- border
- border-bottom
- border-bottom-color
- border-bottom-style
- border-bottom-width
- border-color
- border-left
- border-left-color
- border-left-style
- border-left-width
- border-right
- border-right-color
- border-right-style
- border-right-width
- border-style
- border-top
- border-top-color
- border-top-style
- border-top-width
- border-width
- bottom
- clear
- clip
- color
- content
- counter-increment
- counter-reset
- cursor
- direction
- display
- float
- font
- font-family
- font-size
- font-style
- font-variant
- font-weight
- height
- left
- letter-spacing
- line-height
- list-style
- list-style-image
- list-style-position
- list-style-type
- margin
- margin-bottom
- margin-left
- margin-right
- margin-top
- max-height
- max-width
- min-height
- min-width
- outline
- outline-color
- outline-style
- outline-width
- overflow
- padding
- padding-bottom
- padding-left
- padding-right
- padding-top
- position
- quotes
- right
- text-align
- text-decoration
- text-indent
- text-transform
- top
- unicode-bidi
- vertical-align
- visibility
- white-space
- width
- word-spacing
- z-index
Related: