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;
}
Be sure to review our list of recommended web tools.




Thanks for the tip!
April 29th, 2006 at 2:24 pmMore compatible - with browsers.
h1,h2,h3,h4,h5,h6 {
September 24th, 2006 at 4:18 pmdisplay: inline;
}
Thanks for the additional info Ryan.
September 25th, 2006 at 9:19 am