SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Heading tags increase font size

  1. #1
    SitePoint Zealot
    Join Date
    Oct 2009
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Heading tags increase font size

    I am trying to integrate heading tags within my website. But whenever I use h2 tags, the font size increases. Is the font size supposed to increase when using h2 heading tags? Is there anyway that I could have the fonts remain the same size while using h2 tags? Thanks.

  2. #2
    Robert Wellock silver trophybronze trophy
    SitePoint Award Recipient xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,242
    Mentioned
    51 Post(s)
    Tagged
    0 Thread(s)
    Yes the font size of the more important Headings, e.g. H1 an H2 are typically rendered in a larger font than a paragraph P element because they are headings and not body text. HTML is designed to describe the structure, not the presentation of the document. http://www.w3.org/TR/CSS2/sample.html With CSS you could set the font size and so-forth. Something loosely on the lines of: h2 { font-size : 1em; }
    };-) http://www.xhtmlcoder.com/
    Thinking Web: Voices of the Community

    > March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

  3. #3
    Mouse catcher silver trophy
    SitePoint Award Recipient Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,101
    Mentioned
    66 Post(s)
    Tagged
    1 Thread(s)
    As Robert says, you can use CSS to change the visual appearance of headings in any way you want. In terms of making them the same size as the rest of the text, that's perfectly possible ... although if you aren't going to make the text any bigger than the rest of the content, you have to ask yourself if it really wants to be in an <h2>, because usually you want headings to stand out a bit.
    Any posts I write in Arial are on my mobile phone, so please excuse typos etc.
    Any posts I write in Verdana are on a PC, so feel free to berate me mercilessly for any mistakes


Tags for this Thread

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
  •