Forums

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

Home Forums CSS Spot the problem!

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

    Hi All!

    I have been writing this really simple code, and i am trying to create a simple nav bar. I have started to use Id’s to link styles to certain elements from my stylesheet (thanks @soap!). However, When loading this page up in firefox, SOME of the styles (background-color) load with the rest of the ‘a’ tags on the page. It does work in other browsers, but i believe it is probably a mistake i am making.

    Can anyone help me stop my mistake? Why would the background colour from my list tags continue onto the rest of the page?

    Really grateful for all your help guys.

    "http://www.w3.org/TR/html4/loose.dtd">

    TJ Griffiths

    TJ Griffiths

    Welcome to tjgriffiths.com. In this page you can explore some examples of the work i have been doing over the past couple of years. If you have any queries at all, please feel free to contact me on the address below.

    Never Stop Dreaming.

    GOOGLE

    And my CSS

    #navbar ul
    {
    list-style-type: none;
    }

    #navbar li
    {
    float: left;
    display:inline;
    margin: 5px;
    }

    #navbar a:link,a:visited
    {
    font-weight:bold;
    color:blue;
    background-color:#C0C0C0;
    text-align:center;
    padding:6px;
    text-decoration:none;
    text-transform:uppercase;
    }

    #navbar a:hover,a:active
    {
    background-color:#7A991A;
    }

    body
    {

    background-color:#8ca4ff;
    background-image: url('images/header.jpg');
    background-repeat:repeat-x;
    background-position:left top;
    }

    a
    {
    font-family: arial, verdana, sans-serif;
    font-weight:bold;
    }

    a:link {text-decoration:none;}
    a:visited {color:#0000ff; text-decoration:none;}
    a:hover {text-decoration:underline;}
    a:active {colour:#0000ff; text-decoration:none;}

    h1
    {
    font-family: arial, verdana, sans-serif;
    text-align:center;
    }

    h2
    {font-family: arial, verdana, sans-serif;}

    p
    {font-family: arial, verdana, sans-serif;}

    #59149
    asp
    Participant

    Hi

    I got it to work in my Fierfox. But that is the latest version.

    Maby if you put

    background: none;

    on the link tags the problem will be fixed.

    #58297
    tjgriffiths1
    Participant

    thank you so much @wolfcry911! Works perfectly in various browsers.

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