[thelist] css class vs id

Steve Cook steve.cook at evitbe.com
Fri May 10 02:25:00 CDT 2002


If you check the archives you'll see that there was a discussion of this a
couple of months back. However, the main point is that an ID should only
exist once in a layout. So you could have something like

<p id="title">Main title - style used only once</p>

<p class="subtitle">Subtitle - used continuously throughout the layout</p>

There are some more finesses, but this is the main principle. In practise I
don't think any browsers will complain if you use multiple IDs, but you
should probably avoid it.

.steve


----------------------------------
 Cookstour - http://cookstour.org
----------------------------------



> -----Original Message-----
> From: Scarlett Julian (ED) [mailto:Julian.Scarlett at sheffield.gov.uk]
> Sent: den 10 maj 2002 09:20
> To: 'thelist at lists.evolt.org'
> Subject: [thelist] css class vs id
>
>
> Hi all
>
> are there any pros or cons with using classes rather than
> id's in css (eg
> <div class="foo"> or <div id="foo"> ?
>
> tia
>
> Julian
>
>
>



More information about the thelist mailing list