Prev | Current Page 156 | Next

Charles Wyke-Smith

"Stylin' with CSS: A Designer's Guide 2nd Edition"


Fixed Positioning
Fixed positioning is similar to absolute positioning, except that the
element??™s positioning context is the viewport (the browser window
or the screen of a handheld device, for example), so the element
does not move when the page is scrolled. Figures 4.22 and 4.23
show the effects of ?¬? xed positioning.
FIGURE 4.22 Fixed positioning looks
a lot like absolute positioning??¦
FIGURE 4.23 ??¦until you
scroll the page??”the ?¬? xed
element does not move.
STYLIN??™ WITH CSS - CHAPTER 4 124
This ???nailed-to-the-browser-window??? effect enables you to simulate
the effect of now-deprecated frames. For example, you can create
a navigation element that stays put when the page scrolls without
all the headaches of managing multiple documents in a frameset.
However, IDWIMIE; position:?¬? xed does not work in Internet
Explorer 6, although it does work in Internet Explorer 7. You can
?¬? nd a neat workaround to make ?¬? xed positioning work in Internet
Explorer 6 at TagSoup.com (http://devnull.tagsoup.com/?¬? xed).
Positioning Context
Because positioning context is such an important concept to grasp
if you want to escape from table-based layouts, some more explanation
is useful. Put simply, contextual positioning means that
when you move an element using the properties top, left, right,
or bottom, you are moving that element with respect to another element.


Pages:
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168