I am doing a Saas project, and we want each customer to be able to upload a css page for “his” web site. (Although actually, all of the customer’s sites are hosted by us using virtual hosting).
What are good guidelines when designing the html of a page so that css can be applied a posteriori.
You can have a look at the code at CSS Zen Garden, it’s specifically designed to be stylable.
Generally, you should just use the most natural HTML elements for the function you want. Lists should be lists, links for navigation, et.c.
Use div tags to separate the contents in logical divisions To make elements easy to target, set appropriate classes and id’s on them.
To make links really stylable you can simply add a span tag around the text:
This way it’s easy to give it a dynamic button like look by using the “sliding doors” technique, by adding one background to the anchor tag and another to the span tag. If the link is not styled, the span tag is not affecting the layout at all.