• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Summary

To fully utilize CSS as it was intended, you've got to transform your code. Use abbreviated class and id names, and shorthand properties and grouping to minimize style sheets. Substitute CSS-based layout and rollover techniques for old table-based layout and JavaScript/image rollovers. For smaller tables, style table, row, and cell backgrounds with CSS instead of bgcolor for speed and flexibility. While you are at it, raise your content's relevance by pushing your main content higher in your code, with the table trick or CSS layout techniques. Here's a brief list of what you learned in this chapter:

  • Use shorthand properties, grouping, and abbreviation to optimize your CSS.

  • Substitute CSS-based effects for JavaScript and images (rollovers).

  • Use the hover pseudo-class and styled links or lists to create CSS2 rollovers.

  • Use table-layout:fixed for tables when possible and colgroup and col for speed.

  • Use CSS to color data cells in tables (works in version 4+ browsers).

  • Use CSS layout and positioning control and XHTML to separate presentation from structure to shrink your code, make your layout flexible, and raise search engine relevance.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint