Friday, 8 December 2006

Add multiple class names to HTML elements

I was reading Mads' blog today and came across this post.

I'm amazed I didn't know this either, so I checked back to the HTML 4 spec, and sure enough, this is what it says (bold added by me):

class = cdata-list [CS]
    This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.

Wow, I've learned something new today! I'm now wondering about all the times when I could have used this on web pages I've worked on.

1 comment:

Bronwen said...

That's funny...I only was looking at this on Wednesday...
http://www.soulsolutions.com.au/Blog/tabid/73/EntryID/75/Default.aspx