View Full Version : separating my style and content

02-06-2004, 09:27 AM
Hello all...

I'm working on my personal site, richardmedek.com (http://richardmedek.com). Not too long ago I made the switch from tables to CSS; however, there are a few things I left in the XHTML that deal with presentation. Most of this I don't mind, but the one thing I would like to change is the markup for the menu.

As it is now, the menu is a list of pictures, in black and white. When you rollover the picture, it highlights in color. In a perfect world, each of those links would be background images instead of "<a href...><img ...></a>." But it seems like overkill to assign each link a separate class. I'm also missing a picture for the guestbook page, a suggestion for that gets bonus points :D

I hope this all makes sense... any ideas?


02-06-2004, 11:46 AM
But it seems like overkill to assign each link a separate class.
Perhaps, but that would be the best way to do it. Actually, a seperate id would be better.

02-07-2004, 04:29 AM
...hm... I guess semantically it makes more sense to use IDs. Too bad there's no easier way--or more productive-- way around it :) Thanks for the advice.


02-07-2004, 07:09 PM
Well, not completely necessary, you could use the adjancent sibling selector (+), but you'd drop IE support, and it ultimately carries not advantages. Plus, id is more flexible, allowing you to do more things (such as DOM identification, highlighting the current page (http://www.hicksdesign.co.uk/articles/archives/000271.php) etc.)

If you don't want to populate your markup, use a DOM loop to assign IDs (although you'd have to use IDs of '1', '2', etc.).

02-08-2004, 02:20 AM
thanks me'... yes, those are good alternatives but sure don't look pretty, especially dropping IE support. Oh well, can't have my cake and eat it, too :)