Forums

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

Home Forums CSS noob nav issues

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24728
    kevsyers
    Participant

    Hey guys,

    I have an issue that I’m pretty sure isn’t that big of a deal to figure out, but I can’t seem correct it. My navigation is suppose to highlight when you mouse over it. It actually works in Firefox but doesn’t work in any other browser I’ve tested. I’m using a special font so I’m using images instead of just straight text.

    This is my absolute very first full css site. I built it from scratch so I’m more than positive there are a load of rookie mistakes. Some of which I’m already aware of.

    So here’s the link: http://production.wearecaffeine.com/ubh/

    Here’s my html code:

    I have this wrapped in a div – which I now know you don’t have to do since they are both block level elements…I think that’s right anyways.

    Here’s the css for just the classes li

    Code:
    .menu li{
    float:left;
    text-indent: -9999px;
    }
    .menu li a{
    display:block;
    text-decoration:none;
    }

    li#classes{
    background:url(images/classes.png) 0 0 no-repeat;
    width:57px;
    height:19px;
    }

    li#classes a:hover{
    background:url(images/classes_over.png) 0 0 no-repeat;

    Like I said earlier, I’m completely new to css so be gentle. Thanks in advance

    #56927
    apostrophe
    Participant

    The first thing I notice is that you have your list items inside your anchor links – it should be the other way around.

    Code:
  • Classes

Then in your CSS you have your background on the list item but for the hover state you have it on the link itself – they should both be on the link, thus:

Code:
li#classes a{
background:url(images/classes.png) 0 0 no-repeat;
width:57px;
height:19px;
}

li#classes a:hover{
background:url(images/classes_over.png) 0 0 no-repeat;
}

#56959
kevsyers
Participant

maaaannnn…..that’s what happens when you are up all night look at code. Man thanks for your help, you’re a life saver.

Your advice worked like a charm!

Viewing 3 posts - 1 through 3 (of 3 total)