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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Document Window<br />

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

24 px<br />

1<br />

2<br />

Beginning of body contents. End of<br />

body contents.<br />

3<br />

4<br />

5<br />

6<br />

7<br />

8<br />

(200, 200)<br />

Start of outer<br />

contents. Inner<br />

contents. End of<br />

outer contents.<br />

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

The following example shows an absolutely positioned box that is a child of a<br />

relatively positioned box. Although the parent outer box is not actually offset,<br />

setting its ’position’ property to ’relative’ means that its box may serve as the<br />

containing block for positioned descendants. Since the outer box is an inline box<br />

that is split across several lines, the first inline box’s top and left edges (depicted<br />

by thick dashed lines in the illustration below) serve as references for ’top’ and<br />

’left’ offsets.<br />

#outer {<br />

position: relative;<br />

color: red<br />

}<br />

#inner {<br />

position: absolute;<br />

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

height: 130px; width: 130px;<br />

color: blue;<br />

}<br />

This results in something like the following:<br />

122

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

Saved successfully!

Ooh no, something went wrong!