1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Quick Question Regarding Headings - Changing The Spacing With CSS

Discussion in 'HTML & Website Design' started by bad_bob00, Oct 9, 2008.

  1. #1
    Hi,

    I've inserted some <h1>, <h2>, <h3> etc. tags into my website but each time I insert one it seems to create a space below each tag, which looks like a blank line.

    So for example it looks like this:


    I want to have it so that there is no gap between the heading tag and the next line of my text. Any idea how to do this?
    I've also edited the heading tags in my CSS file, and the code looks like this:

    Any idea how to get rid of the gap that is forces?


    Thanks for any help
     
    bad_bob00, Oct 9, 2008 IP
  2. devguys.com

    devguys.com Peon

    Messages:
    13
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    h2 {
    font-size: 14px;
    color: #cc3300;
    font-weight: bold;
    font-style: italic;
    margin:0px;}
     
    devguys.com, Oct 9, 2008 IP
    bad_bob00 likes this.
  3. Funk-woo10

    Funk-woo10 Peon

    Messages:
    1,109
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #3
    margin:0;
    padding:0;
     
    Funk-woo10, Oct 9, 2008 IP
    bad_bob00 likes this.
  4. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The gap it creates is called a margin. I'd suggest you reduce it to something reasonable rather than use the 0px values the others have mentioned above, simply because you need some form of space below headers and text.
    
    h2 {
    font-size: 14px;
    color: #cc3300;
    font-weight: bold;
    font-style: italic;
    padding-bottom: 0px;
    [B]margin-bottom: 0.8em;[/B]
    } 
    Code (markup):
     
    steelfrog, Oct 9, 2008 IP
    bad_bob00 likes this.
  5. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Thanks for the help guys, sorted it now :)
     
    bad_bob00, Oct 9, 2008 IP