Managing XHTML/CSS Sites
Managing a CSS based site can quickly become bewildering. The following are some suggestions for keeping things manageable:
- Avoid classitis
Creating too many classes will quickly make your code as complicated as the old pre-CSS HTML. By using descendant selectors, you can get very good control without putting any class attributes in your (X)HTML). Diligent use of descendant selectors will mean that classes need only be defined for a few exceptional situations. - Div thoughtfully and consistently
Adopt a standard set of division types in your Web pages, such as header, nav, sidebar, content, sub-content, and footer. Such consistency will allow you to build your system of styles and stylesheets in a way that can be easily transferred to new sites. - Separate types of styles into separate
style sheets
You can link to multiple stylesheets. Placing layout styles in one stylesheet, color and font styles in another, and so on, makes managing the styles more rational. - Separate the roles of content provider and
presentation designer
Take advantage of the ability of (X)HTML/CSS to remove the complexities of presentation from the content to allow your writers and editors to concentrate on what they do best - write and edit. Give the role of presentation design to a person or team that focus on doing it well, including thoroughly testing designs on a variety of browsers.
More information
- Discussing CSS Management and Optimization — fiftyfoureleven.com
- Applied CSS Management and Optimization — fiftyfoureleven.com