22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Document Window<br />

(0,0) (0, 400)<br />

24 px<br />

1<br />

2<br />

Beginning of body contents. Start<br />

of outer contents.<br />

width= 130 px<br />

3<br />

Inner<br />

4<br />

contents.<br />

5<br />

Sibling contents. End of outer<br />

6<br />

contents. End of body contents.<br />

7<br />

8<br />

(400, 0) (400, 400)<br />

9.8.4 Absolute positioning<br />

Finally, we consider the effect of absolute positioning [p. 113] . Consider the<br />

following CSS declarations for outer and inner:<br />

#outer {<br />

position: absolute;<br />

top: 200px; left: 200px;<br />

width: 200px;<br />

color: red;<br />

}<br />

#inner { color: blue }<br />

which cause the top of the outer box to be positioned with respect to its<br />

containing block. The containing block for a positioned box is established by the<br />

nearest positioned ancestor (or, if none exists, the initial containing block [p. 96] ,<br />

as in our example). The top side of the outer box is ’200px’ below the top of the<br />

containing block and the left side is ’200px’ from the left side. The child box of<br />

outer is flowed normally with respect to its parent.<br />

121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!