Can I reduce the space between or after an H heading/tag? With CSS?

Discussion in 'HTML & Website Design' started by Chevere, Jul 18, 2008.

  1. #1
    I wanted to place h1, h2 and h3 tags in the top right corner of our website http://www.communityacceptancemortgage.com/ but we could not because of the extra line H tags gives. Is there a way to reduce the distance under the H tags with CSS?
     
    Chevere, Jul 18, 2008 IP
  2. riftshighway

    riftshighway Active Member

    Messages:
    368
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Yes you can. Do you have a CSS stylesheet applied to your page already?

    If you do, go with something like:

    h1 {
    line-height: 12px;
    }

    Or the like.
     
    riftshighway, Jul 18, 2008 IP
  3. garyc40

    garyc40 Peon

    Messages:
    115
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can manage the space of heading tags by controlling these properties:
    - line-height
    - padding
    - margin

    Currently the lineheight and margin top, margin bottom of your heading are set. You can use css to reset them.
     
    garyc40, Jul 18, 2008 IP
  4. Thailand_for_YOU

    Thailand_for_YOU Guest

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Which of these CSS properties is handling the white space within the tag itself:
    prior to it,
    in between or
    after it
    ?

    In other words, what each of them (- line-height, - padding, - margin ) is handling?
     
    Thailand_for_YOU, Jul 18, 2008 IP
  5. riftshighway

    riftshighway Active Member

    Messages:
    368
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #5
    All of them. To get just the setting you want, you should set each of them to a value.
     
    riftshighway, Jul 18, 2008 IP
  6. leronford

    leronford Peon

    Messages:
    34
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Another idea might be to adjust the font size of the H1 tag itself. This could be done in combination with the suggestions above.
     
    leronford, Jul 18, 2008 IP
  7. Chevere

    Chevere Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thank you!!!
     
    Chevere, Jul 19, 2008 IP