M
Matt Beckwith
Steve Callihan's "Cascading Style Sheets By Example" states that absolute
positioning "...specifies that an element is to be positioned relative to
the containing block."
Yet whenever I specify "position: absolute", the item gets positioned
relative to the body, not the containing block.
How can I use positioning relative to the containing block?
What I want to do is position two things side-by-side:
<div.left>
</div>
<div.right>
<div.rightleft>
</div>
<div.rightright>
</div>
</div>
I'm using the following CSS:
div.rightleft {position: absolute; left: 0px}
div.rightright {position: absolute; top: 0px}
When I do this, everything in div.rightright goes to the top of the screen
(rather than to the top of the div.right area), and div.rightleft goes to
the left margin of the screen.
Thanks in advance.
positioning "...specifies that an element is to be positioned relative to
the containing block."
Yet whenever I specify "position: absolute", the item gets positioned
relative to the body, not the containing block.
How can I use positioning relative to the containing block?
What I want to do is position two things side-by-side:
<div.left>
</div>
<div.right>
<div.rightleft>
</div>
<div.rightright>
</div>
</div>
I'm using the following CSS:
div.rightleft {position: absolute; left: 0px}
div.rightright {position: absolute; top: 0px}
When I do this, everything in div.rightright goes to the top of the screen
(rather than to the top of the div.right area), and div.rightleft goes to
the left margin of the screen.
Thanks in advance.