colinramsay.co.uk

Breaking Point

03 Nov 2004

Within the web design profession, most people seem to be picking up on the idea of web standards. Casting aside for a moment talk of whether the term "web standards" is so great, I wonder how many people are truly advocates and how many are in it for the buzzwords.

When I talk about web standards, I'm pretty much using an umbrella term which refers to the use of CSS, valid HTML, and semantic accessible markup when creating a site. It's all very well if your website validates, but if you're not in the spirit of it, with well-used markup, then surely you're missing the point?

Anyway, back to the title of this post. I've seen a lot of people using the BR tag in their sites, particularly to present menus and lists of links. No. No, no, no. This is totally wrong, and defeats the purpose of using CSS to lay out your website. The point of CSS is that it allows flexibility. By separating content from *yawn* yes. You've heard that before. Clearly some people weren't listening.


<a>my link</a><br/>
<a>my link</a><br/>
<a>my link</a>

Well done, you've created a vertical list of links! But you've done it in a terrible way. The BR tag causes a line break. What if you want to change your list to a horizontal list? You'd be knackered. Here's the right way:


<ul>
<li><a>my link</a></li>
<li><a>my link</a></li>
<li><a>my link</a></li>
</ul>

A little more markup, but it's correct markup. You have a list of links - put them in a list! And now that we have removed the line break tags, we can format the list however we want - vertically or horizontally. So please kids, follow the spirit and not the letter of the web standards movement.