#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Location
    San Diego
    Posts
    97
    Rep Power
    10

    Wondering why a ul class isn't cancelling out the ul id


    http://projects.describe.org/esdcar/membership/discounts.html

    .nohouse is inside the contentmain div with an id of #contentmain

    the relevant css looks like this:

    #contentmain {
    background-color: #ffefca;
    clear: left;
    margin-top: 0em;
    margin-bottom: 0em;
    padding-left: 2%;
    padding-right: 2%;
    padding-top: 1.2em;
    }

    #contentmain ul {
    list-style-image: url(../images/icons10_webpage.gif);
    list-style-type: circle;
    text-decoration: none;
    font-size: .8em;
    margin-bottom: 1em;
    margin-left: 2.5em; }

    #contentmain li {
    margin-bottom: .6em;
    }

    #contentmain li.lastli {
    margin-bottom: 2.5em;
    }

    .nohouse ul {
    list-style-image: none;
    list-style-type: none;
    text-decoration: none;
    font-size: .8em;
    margin-bottom: 1em;
    margin-left: 2.5em;
    }
  2. #2
  3. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    A class is less specific than an id, so the id overrules the class.
    http://www.w3.org/TR/CSS21/cascade.html#specificity

    Since the class is within the contentmain id,
    simply use them both when you are refering to that element.

    Code:
    #contentmain .nohouse ul {
      list-style-image: none;
      list-style-type: none;
      text-decoration: none;
      font-size: .8em;
      margin-bottom: 1em;
      margin-left: 2.5em;
    }

    Comments on this post

    • Grafmix agrees

IMN logo majestic logo threadwatch logo seochat tools logo