Forum Moderators: not2easy
Problem is, the 2nd div is 100% the size of the first one, and it completely covers it up. Am I missing something?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">#floatBox {
position: fixed;
top: 1%;
left: 5%;
width: 90%;
height: 90%;
overflow: scroll;
background-color:#CCFFFF;
border: 1px solid #003399;
}
body {
height: 100%;
}
</style>
</head>
<body>
<p>this is some normal content.</p>
<div class="floatBox"><p>this is some floated content.</p>
<div class="floatBox"><p> this is some more floated content, within the other floated content.</p>
</div>
</div>
</body>
</html>
[w3.org ]
Fixed positioning is a subcategory of absolute positioning. The only difference is that for a fixed positioned box, the containing block is established by the viewport.
[edited by: Robin_reala at 11:58 am (utc) on April 15, 2008]
actually what I'm really using is an absolute box within an absolute box that's scrollable. I'd like to update the internal box to be position:fixed so that if the container is scrolled, the internal box still shows up where I want.
since position fixed takes it's size and location from the viewport, that'll be much more difficult