SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist artcoder's Avatar
    Join Date
    Aug 2005
    Location
    Planet Earth
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Horizontal Menu needs Menu Item selected

    I have a CSS horizontal menu using unordered-list.

    The "Web" tab of this page

    is selected perfectly fine in Firefox.

    But the tab is not properly selected in IE.

    Here is my CSS.

    I'm using this CSS rule to select the tab ...

    ul#menu li.selectedtab a {
    background-image: url('images/tabselected.jpg');
    background-repeat: no-repeat;
    font-weight: bold;
    color: #996633
    }

    I've have tried putting the "selectedtab" on the "a" instead of the "li" without success. Can anyone help me get this to work in IE.

  2. #2
    SitePoint Enthusiast ada80ro's Avatar
    Join Date
    Apr 2005
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try to remove these comments (you have two) from your html:
    <!-- ---------------- -->

    The number of hypens must be a multiple of four but is recommended to remove all other hypends from your comment.
    http://www.htmlhelp.com/reference/wi...c/comment.html

  3. #3
    SitePoint Evangelist artcoder's Avatar
    Join Date
    Aug 2005
    Location
    Planet Earth
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for pointing out my mal-formed HTML comments (which I promptly fixed). However, that was not the cause of the problem.

    It turns out that the problem was that IE was seeing the link as "visited" (hence no selected in the tab).

    I changed from ...

    ul#menu li.selectedtab a {
    ...
    }

    to ...

    ul#menu li.selectedtab a, ul#menu li.selectedtab a:visited {
    ...
    }

    and it worked.


Bookmarks

Posting Permissions

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