Prev | Current Page 131 | Next

Charles Wyke-Smith

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


Now that you understand the basics of CSS and how to style text,
let??™s move on to creating multicolumn page layouts.
CHAP T E R 4
Positioning Elements
101 STYLIN??™ WITH CSS
ONE OF THE KEY STEPS in the adoption of Web standards
has been the abandonment of tables as a means of laying out
pages. Tables were never meant to be used in this way??”they
were intended to be used for laying out grids of data, in a
similar manner to an Excel spreadsheet. However, before the
development of CSS, tables were used to create a page grid
into which elements could be organized into columns. This
meant adding nasty presentational hacks??”such as spacer
GIFs, line breaks, and non-breaking spaces??”into the markup
to achieve the desired layout. With CSS, you can position
XHTML elements with great accuracy without adding presentational
elements into your markup.
With the application of CSS properties, such as margins,
padding, and borders, and CSS techniques, such as ?¬‚ oating
and clearing, you can achieve the same??”and even better??”
results than in the past. You can do this while keeping your
markup lean and clean, and while sharing the styles you write
between like elements of your layout. This results in lightweight
and easy-to-read code.
STYLIN??™ WITH CSS - CHAPTER 4 102
How well you succeed with these techniques depends on how well
you understand the box model, the position property, and the display
property.


Pages:
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143