3.3 Use style sheets to control layout and presentation

Make sure that when you create your pages, you do so with the proper structural tags and then use style sheets to control presentation and layout. First design pages that make sense without style sheets (i.e. write the page in a "logical" order) and then apply style sheets to achieve visual effects. If you use markup correctly, a page still displays correctly and is structurally sound even without an associated style sheet. What you are looking for, ideally, is a page that reverts to almost zero style when this is disabled - a case of 'less is more'.

You should:

You can use the following CSS techniques to control the format and position of text:

The following example shows how to use style sheets to create a drop-cap effect:

<style type="text/css">
.dropcap {font-size : 120%; font-family : Helvetica}
</style>
<p><span class="dropcap">O</span>nce upon a time...
</p>

You can use the following CSS techniques to control layout, positioning and alignment:

Don't use on images to control layout. Many people use lots of little images to get round the fact that HTML isn't very good at layout. These images make it diffcult for browsers to recognise what is content and what is spacers. Set your margins, padding, spacing and positioning in your style sheet.