Forums

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

Home Forums CSS DIV background color remains white even when style says differently

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #44187

    I’m just learning CSS right now, and when I use the a:link a:visited a:hover tag, the color won’t change even if I change the code.. it’s weird.

    #navigation
    {
    float:right;
    height:48px;
    width:540px;
    background-color:#062134;
    margin-right:11.5%;
    margin-top:2.69%;
    }

    ul
    {
    padding:0;
    list-style:none;
    }

    li
    {
    width:85px;
    height:48px;
    float:left;
    font-family: Arial, Helvetica, sans-serif;
    text-align:center;
    }

    #navigation a:link, a:visited
    {
    display:block;
    height:33px;
    background-color:#062134;
    color:#fff;
    text-decoration:none;
    font-family:Arial, Helvetica, sans-serif;
    font-size:16px;
    font-weight:light;
    padding-top:15px;
    }

    #navigation a:hover
    {
    background-color:#062134;
    color:#306489;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;
    transition:.5s;
    }

    I want the links to look like they’re in another div (wrapper, to be specific), with the help of another div.

    Help, please?

    #132132
    Paulie_D
    Member

    I’m entirely sure what it is you are trying to do.

    Seems to be fine: http://codepen.io/Paulie-D/pen/syltf

    >I want the links to look like they’re in another div (wrapper, to be specific), with the help of another div.

    I have no idea what this means.

    #132133
    Paulie_D
    Member

    Please note that this…

    #navigation a:link, a:visited

    should be this…

    navigation a:link, #navigation a:visited

    #132134

    Yes, that’s exactly what I want. But I don’t know why it shows the background color as white on any browser I open. It’s weird. :S

    #132135

    Ah! Yes, that fixed it. Thanks a lot! :)

    #132235
    jurotek
    Participant

    @abhaykatre, since you just starting to learn CSS, [Here’s an example . . ](http://codepen.io/jiri/pen/FCqHD “”) of slightly better coded navigation.

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