SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot theslip's Avatar
    Join Date
    Jun 2008
    Location
    here
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question class not working quick issue

    Hi Guys,

    Any ideas why my li's with a class of smaller dont look smaller font?

    #secondaryNav li{
    color:#666666;
    font-size:14px;
    }

    .smaller {
    font-size:10px;
    }

    cheers


  2. #2
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tested locally in Opera works for me. Maybe some other rule that's overriding it?
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because the first selector is more specific, and that rule will therefore take precedence.

    You'll have to make the second selector equally specific or more specific than the first one:
    Code CSS:
    #secondaryNav .smaller {
      font-size:10px;
    }
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Luki_be View Post
    Tested locally in Opera works for me.
    I doubt that very much. What version of Opera are you using? Opera 10.51 definitely does the right thing by not applying the second rule.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    I doubt that very much. What version of Opera are you using? Opera 10.51 definitely does the right thing by not applying the second rule.
    No you're right.... by using his code i already made the class more specific....
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •