BLOG: HTML or CSS for Layout?


There are two general approaches to creating layouts on a Web page: HTML tables or Cascading Style Sheets (CSS). The tables method is the classic approach. It's easy to do, and it works reliably across many different types of browsers. However, using HTML tables for layout gets the standards police all in an uproar. Groups like the World Wide Web Consortium (W3C) hate it when you use tables this way, because HTML's table tags are supposed to be for rows and columns of data. Using tables for graphic design is like using a hammer to pound in a screwit gets the job done, but not the job that the hammer or screw had in mind. This type of argument isn't entirely nitpicking. Accessibility devices like text-to-speech converters and screen readers rely on strict interpretations of HTML standards, so your tables-based layout could very easily play tricks on the visually impaired. In spite of these limitations, tables-based layout dominates the Web.

The CSS alternative follows spec to the letter, satisfying even the most fastidious members of the W3C. CSS has been around for a while, but it is still very much a maturing technology. Style sheets wouldn't be so bad if browsers would get their collective acts together with regard to them. The latest versions of Internet Explorer, Netscape, and Opera support CSS reasonably well, but none of them supports it entirely and not without significant inconsistencies. Building a CSS layout requires more effort and more testing time, and it seems to work best with straightforward designs. Still, CSS-based layout or something very much like it is the future of graphic design on the Web.

If you're trying to reach the largest audience possible, your choice is easy: Go with tables. However, if you're mindful of standards and accessibility concerns and have an eye to the future, CSS is the choice for you.



Web Design Garage
Web Design Garage
ISBN: 0131481991
EAN: 2147483647
Year: 2006
Pages: 202
Authors: Marc Campbell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net