I am trying to create an filled rectangle using the div tag that is 5
pixels high. It appears to be taller than 5 pixels unless I use the
OVERFLOW: HIDDEN attribute.
Since the DIV is empty, why do I need the overflow attribute?
HTML to follow shows two divs that are identical except for the
overflow attribute. The one with the overflow attribute appears the
way I expect, but the other one does not.
Can someone please explain in detail if the overflow is necessary and
why, or how to achieve the same result without overflow?
Thanks in advance,
Randy
<style type="text/css">
<!--
div.tooTall{
left: 10; width: 300px; position: relative; top: 40px; height: 5px;
border: 1px solid #000; background: blue;
}
div.justRight{
left: 10; width: 300px; position: relative; top: 140px; height: 5px;
border: 1px solid #000; background: red;
overflow:hidden ;
}
-->
</style>
<div class="tooTall" >
</div>
<div class="justRigh t"></div>
pixels high. It appears to be taller than 5 pixels unless I use the
OVERFLOW: HIDDEN attribute.
Since the DIV is empty, why do I need the overflow attribute?
HTML to follow shows two divs that are identical except for the
overflow attribute. The one with the overflow attribute appears the
way I expect, but the other one does not.
Can someone please explain in detail if the overflow is necessary and
why, or how to achieve the same result without overflow?
Thanks in advance,
Randy
<style type="text/css">
<!--
div.tooTall{
left: 10; width: 300px; position: relative; top: 40px; height: 5px;
border: 1px solid #000; background: blue;
}
div.justRight{
left: 10; width: 300px; position: relative; top: 140px; height: 5px;
border: 1px solid #000; background: red;
overflow:hidden ;
}
-->
</style>
<div class="tooTall" >
</div>
<div class="justRigh t"></div>
Comment