Recommended Web Tools Blog

We want YOUR input.

Know of a good web tool, web design resource or some other useful website?

Then contact us!

User input is instrumental in keeping ideas and tools fresh and helpful.

Removing Line Breaks/Space Before/After H1 tags


by Paul Flyer

Header Tags (h1,h2,h3,h4,h5,h6) produce a space/break above and below the enclosed text. Sometimes this is not desireable. To remove the space from below the tag use this in the CSS file:


h1,h2,h3,h4,h5,h6{
margin-bottom: 0px;
padding-bottom: 0px;
}

Similarly, the code for removing the space from above a H1 tag:


h1,h2,h3,h4,h5,h6{
margin-top: 0px;
padding-top: 0px;
}

Of course, these two can be combined to remove the space from both above and below a H1 tag. Remember, shorthand can be used to accomplish this.


h1,h2,h3,h4,h5,h6{
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}

01.06.2006 @ 9:36 PM — Filed under:

Be sure to review our list of recommended web tools.

TrackBack this entry

Comments »

  1. chris comments:

    Thanks for the tip!

    April 29th, 2006 at 2:24 pm


  2. Ryan comments:

    More compatible - with browsers.

    h1,h2,h3,h4,h5,h6 {
    display: inline;
    }

    September 24th, 2006 at 4:18 pm


  3. Paul Flyer comments:

    Thanks for the additional info Ryan.

    September 25th, 2006 at 9:19 am


Leave a comment

Note: All comments are moderated. It may take 24-72 hrs for your comment to appear.