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.

position: fixed;<br />

width: 100%;<br />

height: 100px;<br />

top: auto;<br />

right: 0;<br />

bottom: 0;<br />

left: 0;<br />

}<br />

<br />

<br />

<br />

... <br />

... <br />

... <br />

... <br />

<br />

<br />

9.7 Relationships between ’display’, ’position’,<br />

and ’float’<br />

The three properties that affect box generation and layout -- ’display’, ’position’,<br />

and ’float’ -- interact as follows:<br />

1. If ’display’ has the value ’none’, user agents must ignore [p. 42] ’position’<br />

and ’float’. In this case, the element generates no box.<br />

2. Otherwise, ’position’ has the value ’absolute’ or ’fixed’, ’display’ is set to<br />

’block’ and ’float’ is set to ’none’. The position of the box will be determined<br />

by the ’top’, ’right’, ’bottom’ and ’left’ properties and the box’s containing<br />

block.<br />

3. Otherwise, if ’float’ has a value other than ’none’, ’display’ is set to ’block’<br />

and the box is floated.<br />

4. Otherwise, the remaining ’display’ properties apply as specified.<br />

Note. <strong>CSS2</strong> does not specify layout behavior when values for these properties<br />

are changed by scripts. For example, what happens when an element having<br />

’width: auto’ is repositioned? Do the contents reflow, or do they maintain their<br />

original formatting? The answer is outside the scope of this document, and such<br />

behavior is likely to differ in initial implementations of <strong>CSS2</strong>.<br />

9.8 Comparison of normal flow, floats, and absolute<br />

positioning<br />

To illustrate the differences between normal flow, relative positioning, floats, and<br />

absolute positioning, we provide a series of examples based on the following<br />

HTML fragment:<br />

<br />

<br />

<br />

Comparison of positioning schemes<br />

<br />

<br />

Beginning of body contents.<br />

115

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

Saved successfully!

Ooh no, something went wrong!