]> (X)HTML | Web Developer Reference Blog

Implementing CSS

Thursday, February 25th, 2010

CSS can be implemented inline (<p style=”font-family: Arial, Tahoma;”>text</p>), in the header (<style type=”text/css”><!– p { font-family: Arial, Tahoma; } –></style>) or in an external style sheet. The way you use depends on the situation.

When marking up a template, the easiest method is to use inline, then use html tidy to assign classes and ids for the different styles.

Using the header is often good to speed up a page if you need to import a style-sheet if the browser is Internet Explorer but run the non-IEĀ import first so the styles are overridden if the browser being used is IE.