Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Horizontal Nav Bar – First Ul Li

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #176378
    Cathyk
    Participant

    Want to hover over first item in nav bar and have background fill. Item is not intentionally linked. Need the same effect as the linked li. View page at http://cathywordpress.com/Testing/FaithRebuild/pastors2cents.html.

    #176403
    Paulie_D
    Member

    This is your code for the linked a tags

    #nav a:hover {
    text-decoration: underline;
    background: #f1f1f1;
    }
    

    For the unlinked li which really should contain a link then you wouldn’t have this problem…and it would make the submenu on that menu item line up as well (I think).

    You would have to do

    #nav li:hover {
        background: #f1f1f1;
    }
    

    Note that this will affect all the li but that shouldn’t matter as the a tags will cover it up.

    For the first menu item at the very least the text should be in a proper text tag and not a text node although, as I said, there should be no reason not to have a link in there.

    #176424
    Cathyk
    Participant

    Thanks for responding. I do have the #nav li:hover {
    background: #f1f1f1;
    }. However it just fills the area behind the text. Is the proper protocol/best practice to have each item linked or just your personal opinion?

    #176532
    Cathyk
    Participant

    Thanks, janet4now. Rethinking my layout and your suggestion seems to be the best way to go.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.