Can You Make The H2 Tag Unbolded?

Discussion in 'Web Design' started by redrubies, Aug 11, 2012.

  1. redrubies

    redrubies Supreme Member

    Joined:
    Jan 17, 2011
    Messages:
    1,425
    Likes Received:
    2,590
    Location:
    USA
    I have an h2 tag that looks stupid bolded. Is there any way to unbold it? Nothing I am doing is working. Thanks!
     
  2. derzok

    derzok Newbie

    Joined:
    Aug 11, 2012
    Messages:
    15
    Likes Received:
    4
    Yes, you can do this with css:

    Code:
    h2 { font-weight: normal; }
    
    or inline:

    Code:
    <h2 style="font-weight: normal;">My Stuff Here</h2>
     
    • Thanks Thanks x 1
  3. Namun

    Namun Junior Member

    Joined:
    Sep 13, 2008
    Messages:
    137
    Likes Received:
    176
    If that doesn't work, use:

    Code:
    h2 { font-weight: normal!important; }
     
    • Thanks Thanks x 1
  4. redrubies

    redrubies Supreme Member

    Joined:
    Jan 17, 2011
    Messages:
    1,425
    Likes Received:
    2,590
    Location:
    USA
    Thank you, thank you, thank you!
     
  5. RightInTwo

    RightInTwo Power Member

    Joined:
    Feb 23, 2010
    Messages:
    746
    Likes Received:
    383
    Also if it is inline, you can do something like this:

    <h2 style="font-size: 12pt; font-weight: none;">text goes here</h2>
     
    • Thanks Thanks x 1
  6. derzok

    derzok Newbie

    Joined:
    Aug 11, 2012
    Messages:
    15
    Likes Received:
    4
    Good call Namun - using !important is very handy sometimes. For the OP: !important makes it so that the attribute overrides all other CSS. Of course, using !important is kind of bad practice - it usually implies that your code is poorly organized and that you have overlapping CSS rules. CSS should inherit - not overlap.

    And in my experience, when people start using !important, they start using it everwhere... which gets even messier.

    Just fyi: if you have more than one !important effecting the same attribute, the first one overrides the later ones (so the order in which your css is included/interpreted matters).
     
  7. redrubies

    redrubies Supreme Member

    Joined:
    Jan 17, 2011
    Messages:
    1,425
    Likes Received:
    2,590
    Location:
    USA
    Your first inline code worked just great. I have been making my sites for over 10 years and would you believe that I never looked into how to unbold an h2 tag? I never had a need to because I always meant for what I wanted there to be bolded. But I wanted a delicate look for this site.
     
  8. derzok

    derzok Newbie

    Joined:
    Aug 11, 2012
    Messages:
    15
    Likes Received:
    4
    It's good practice when building websites to use what they call a "CSS reset" - it essentially takes all the default formatting out. It removes the sizes/font-weights from the H tags, it removes margins/paddings from p tags. It takes the bullets off of li tags and stuff like that. That way you can make a website that isn't dependent upon any of these defaults (especially since some browsers interpret these defaults differently).
     
    • Thanks Thanks x 1
  9. redrubies

    redrubies Supreme Member

    Joined:
    Jan 17, 2011
    Messages:
    1,425
    Likes Received:
    2,590
    Location:
    USA
    That's a good idea because I spend more time changing defaults. The defaults irritate me.
     
  10. bovaum

    bovaum Newbie

    Joined:
    Jul 27, 2012
    Messages:
    20
    Likes Received:
    2
    There are a number of good reset scripts to start from, anymore I tend to create sites using Twitter Bootstrap though there are a number of good examples listed at

    hxxp stackoverflow [c*m] [slash] questions [slash] 116754 [slash] best-css-reset


    my apologies for the mangled url -- a google search for "reset css" will also turn up some good boilerplates to use
     
    • Thanks Thanks x 1
  11. tristangemus

    tristangemus Regular Member

    Joined:
    Feb 10, 2009
    Messages:
    283
    Likes Received:
    110
    Location:
    Canada
    Home Page:
    Edit your style page if you have one and make sure there isn't a bold setting under the h2 part.