- Home
- Style Sheets
- Clean Page Structure: Headings and Lists
Clean Page Structure: Headings and Lists
- By Mike Tayler
- Published 03/11/2007
- Style Sheets
- Unrated
Mike Tayler
View all articles by Mike Tayler
When HTML started, people put all sorts of things on their pages: there was a tag to say which font you wanted your text to be in, a tag to say you wanted it to be in the centre of the page, and so on. Now, though, that way of writing pages is out-of-date and very inefficient compared to keeping content and style separate using CSS.
What is CSS?
CSS stands for Cascading Style Sheets – it is basically a way of saying once what you want your pages to look like, instead of having to repeat it in HTML all the way through the document. In old style HTML, for example, this kind of code was a relatively common sight:
Welcome to my website!
I hope you enjoy your visit.
Now, though, you can remove the font tags altogether, and just have this:
Welcome to my website!
I hope you enjoy your visit.
At the top of your website, you put a style tag, like this:
p { font-family: Arial, }
Now, instead of having to say again which font you’re using with every new paragraph, you’ve told the browser that you want every paragraph you’ve got to be in Arial.
Headings and Lists.
Thanks to CSS, you can make documents that are more ’semantically correct’ – that is, they would make sense to a human reading them, instead of having to be weighed down with lots of extra presentation code. This has two great effects: it makes web pages smaller (and so faster to download), and it makes them simpler.
On a modern web page, the only things you should ever need to include apart from paragraphs of text are headings and lists. After all, web pages are just text, graphics and navigation put together in a particular order – there’s no reason for things to be done as messily as they often are.
You use headings for the title and subtitles of your page – they’re the HTML tags that begin with h. You might, for example, write
< h1 >website title< /h1 >,< h2 >article title< /h2 >.
Lists, on the other hand, can be used for pretty much anything else that isn’t paragraphs of text. Instead of just putting links one after the other to make a navigation bar, for example, you should put them in a list, using the ul and li tags. Not only is this easier for you to read and add to, but it’s also more compatible with non-graphical browsers.
A typical list looks like this:
- item 1
- item 2

