Prev | Current Page 152 | Next

Charles Wyke-Smith

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


2. To add a border around a number of ?¬‚ oated elements. Enclose the ?¬‚ oated elements in a wrapper div and add the
clear?¬? x class to this wrapper so it encloses the ?¬‚ oated elements. Then style the border of this containing element.
This is one of those techniques where you don??™t know why you would need it until you need it; one day, though, you
will. It sure beats adding lots of clearing divs into your markup and is very simple to use.
Note that IE6 incorrectly causes a div that contains ?¬‚ oated elements to enclose those elements, so this is just one more
reason to develop in a standards-compliant browser and test with IE afterwards.
To learn more about the Aslett Clearing Method, check out Position Is Everything (www.positioniseverything.net/
easyclearing.html).
STYLIN??™ WITH CSS - CHAPTER 4 120
The Position Property
At the heart of CSS-based layouts is the position property. The
position property determines the reference point for the positioning
of each element box.
Let??™s look at what this means.
There are four values for the position property: static, absolute,
?¬? xed, and relative. static is the default. These terms didn??™t seem
to map to what they actually do when I ?¬? rst encountered them.
To help you avoid puzzling over what each does, let??™s take a quick
look at each using a simple example with four paragraphs.


Pages:
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164