ID and CLass in the same sheet

Discussion in 'CSS' started by qwicker, Aug 12, 2007.

  1. #1
    Hello, I am somewhat of a noob here and I cannot get this css sheet to work. I have classes and ID's and I know it is something very simple in the css file because when i remove the classes, the page works fine....When i view this, I dont see the formatting I have defined as #'s. If i remove .cellbg, .title, .slogan, it all appears perfect..... I seem to be having a problem. Thank you!

    .cellbg {
    background-image: url(images/header_bkgd.gif);
    background-repeat: no-repeat;
    background-position:center top;
    }
    
    .title {
    font: 30px Algerian; color: white
    }
    .slogan {
    font: 30px Freestyle Script; color:white
    )
    
    #menu {
    width: 12em; /* set width of menu */
    background: #eee;
    } 
    
    #menu ul { /* remove bullets and list indents */
    list-style: none;
    margin: 0;
    padding: 0;
    }
    
    /* style, color and size links and headings to suit */
    #menu a, .menu h2 {
    font: bold 11px/16px arial, helvetica, sans-serif;
    display: block;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc #888 #555 #bbb;
    margin: 0;
    padding: 2px 3px;
    }
    
    #menu h2 {
    color: #fff;
    background: #000;
    text-transform: uppercase;
    }
    
    #menu a {
    color: #000;
    background: #efefef;
    text-decoration: none;
    }
    
    #menu a:hover {
    color: #a00;
    background: #fff;
    }
    Code (markup):
     
    qwicker, Aug 12, 2007 IP
  2. ginner

    ginner Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    could you post your html up as well so that i can see you structure maybe its something in the html cause i cant really think wats a matter with your css it all looks find to me thanks

    ginner
     
    ginner, Aug 15, 2007 IP
  3. srobona

    srobona Active Member

    Messages:
    577
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    88
    #3
    .cellbg {
    background-image: url(images/header_bkgd.gif);
    background-repeat: no-repeat;
    background-position:center top;
    }
    
    
    Code (markup):
    Try this
    
    .cellbg {
    background: url(images/header_bkgd.gif) no-repeat center top;
    }
    
    
    Code (markup):
     
    srobona, Aug 15, 2007 IP
  4. ginner

    ginner Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    how i usually do this is say i am gonig to create a header

    here goes

    #header{
    theh the attributes
    }

    say then i am gonig to put some txt in the header then

    #header .companyname{
    then attributes
    }

    html side would be

    <div id="header">
    <div class="companyname"></div>


    hope this has made you understand a little bit better
     
    ginner, Aug 15, 2007 IP