CSS class cannot unbold a link.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nico-t
    emperor of my world
    • Aug 2004
    • 29903

    #1

    CSS class cannot unbold a link.

    Weird, links within div class tags (class small) with this css:

    .small {
    color: Silver;
    font-weight: normal;
    font-size: 11px;
    }

    .small a {
    color: Blue;
    font-weight: normal;
    }


    Are still bold. Because the wrapper div has all links bold. I thought this should override it? It overrides the color fine.... why not the 'normal' font weight?
  • MetaMan
    I AM WEB 2.0
    • Jan 2003
    • 28682

    #2
    you can go like:

    <div style="font-weight:normal;">text here</div>

    to see if it overrides it. it shouldnt get the bold from the wrap but i cant see the entire code so hard to say.

    Comment

    • MetaMan
      I AM WEB 2.0
      • Jan 2003
      • 28682

      #3
      .small {
      font: normal 12px Arial, Helvetica, sans-serif;
      }

      is so much cleaner also

      Comment

      • redwhiteandblue
        Bollocks
        • Jun 2007
        • 2793

        #4
        What browser? Looked at it in Firebug to see what its properties actually are? Tried setting it in the link pseudo-classes?
        Interserver unmanaged AMD Ryzen servers from $73.00

        Comment

        • nico-t
          emperor of my world
          • Aug 2004
          • 29903

          #5
          I had to change the ".small" from a class to a div id, and the a to the more specific a:link for it to work. Like this (and ofcourse change the "div class=" to "div id=" in the html tags around the links i wanted to change):

          #small {
          color: Silver;
          font-weight: normal;
          font-size: 11px;
          }

          #small a:link {
          color: Blue;
          font-weight: normal;
          }

          dont know why a class doesnt work but hey, this works too.

          Comment

          • pornpf69
            Too lazy to set a custom title
            • Jun 2004
            • 15782

            #6
            could have been easily solved by adding a small thing: !important;
            .small a {
            color: Blue;
            font-weight: normal !important;
            }

            not that hard...

            Comment

            • brandonstills
              Confirmed User
              • Dec 2007
              • 1964

              #7
              It may be a problem of specificity. I run into these problems occasionally. They are so annoying.

              http://css-tricks.com/specifics-on-css-specificity/

              Basically the solution is to put the tag hierarchy in front of it or to use id's. If the specificity value is too low it won't pick it up.

              Brandon Stills
              Industry and programming veteran
              [email protected] | skype: brandonstills | ICQ #495-171-318

              Comment

              • FlexxAeon
                Confirmed User
                • May 2003
                • 3765

                #8
                the sad part is that with all of these different solutions, no one is 'more correct' than another
                flexx [dot] aeon [at] gmail

                Comment

                Working...