Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts

    separating my style and content

    Hello all...

    I'm working on my personal site, 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

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

    -Rich

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    That's it!

    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.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    ...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.

    -Rich

  • #4
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 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.).
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #5
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •