Hour 12Formatting Web Pages with CSS Style Sheets

In the preceding hour you learned how to use tables to lay out information in rows and columns. Tables have been used heavily across the Web as a page layout tool, but they’re now being phased out for that particular purpose thanks to style sheets. Tables are still fine to use but you should focus on using them for their true intent, which is arranging tabular information into rows and columns. In addition to replacing tables as the page layout mechanism of choice, style sheets also are the preferred way to apply fonts, control margins, specify borders, and tweak just about every other visible aspect of web pages.

The concept behind style sheets is simple: You create a single style sheet ...

Get Sams Teach Yourself HTML and CSS in 24 Hours, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.