<html>
<head>
<title>Abakada DHTML Demo: CSS overflow Attribute</title>
<link rel="stylesheet" href="/shared/netdemos.css">
</head>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>Abakada DHTML Demo: CSS overflow Attribute</h2></div>
<hr size=1 width=92%>
<center>
<h5>This example shows the effects of applying different values possible for the CSS <b>overflow</b> attribute.</h5>
<p id="msg">Select from the <b>overflow</b> options below to see how the style is applied, <br>
and note the resulting CSS syntax for the style declaration. </p>
<h5 id="theSyntax">Syntax { overflow: auto }</h5>
<div id="theDiv" style="background: whitesmoke;
width: 300; height: 150; overflow: auto; border: 1px inset">
<p>This <b>DIV</b> object has a lot of information. </p>
<p>So much information, in fact, that this text will extend beyond the height and width values specified in an inline style. </p>
<p>One of the ways to manage this is with the CSS <b>overflow</b> style attribute. </p>
<p>By setting the <b>overflow</b> style attribute inline on the <b>DIV</b> with a value of <i>auto</i>, the <b>DIV</b> will automatically add scrollbars if necessary. </p>
<p>Experiment with the different overflow settings by selecting from the options below. </p>
</div>
<br>
<table cellpadding=5>
<tr>
<td><b>Select Option</b></td>
<td><select name="units" tabindex=1 onchange="chgProp ( this.value )">
<option value="auto">auto
<option value="visible">visible
<option value="scroll">scroll
<option value="hidden">hidden
</select></td>
<td><button onclick="reset ( )">Reset</button></td></tr>
</table>
</center>
<script language="JavaScript">
<!--
var el = document.all ? document.all [ 'theDiv' ] :
document.getElementById ( 'theDiv' );
var synt = document.all ? document.all [ 'theSyntax' ] :
document.getElementById ( 'theSyntax' );
function chgProp ( of ) {
el.style.overflow = of;
txt = "Syntax { overflow: " + of + " }";
if ( document.all ) synt.innerText = txt;
else if ( dom ) synt.childNodes [ 0 ].nodeValue = txt;
}
function reset ( ) {
list = document.all ? document.all [ 'units' ] :
document.getElementById ( 'units' );
list.value = "auto";
el.style.overflow = "auto";
txt = "Syntax { overflow: auto }";
if ( document.all ) synt.innerText = txt;
else if ( dom ) synt.childNodes [ 0 ].nodeValue = txt;
}
//-->
</script>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>