homepage Welcome to WebmasterWorld Guest from 54.161.190.9
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
How to fix blank space below h1 tags
stevelibby




msg:3596327
 3:12 pm on Mar 10, 2008 (gmt 0)

if i set a h1 to 12pt or anything else i am left with a blank space under it? is there a way i can close this gap?

 

dreamcatcher




msg:3596381
 3:52 pm on Mar 10, 2008 (gmt 0)

In your stylesheet, remove the default padding:

h1 {
padding:0;
}

dc

stevelibby




msg:3596450
 4:44 pm on Mar 10, 2008 (gmt 0)

hi
there is not a padding in there?

pageoneresults




msg:3596453
 4:48 pm on Mar 10, 2008 (gmt 0)

It could be padding, margin or line-height.

font: normal 12px/12px arial, sans-serif;

stevelibby




msg:3596500
 5:27 pm on Mar 10, 2008 (gmt 0)

h1 { font-size: 12pt; font-weight: bold; font-family:Tahoma }

swa66




msg:3596776
 9:20 pm on Mar 10, 2008 (gmt 0)

Your browser would have typically some preset padding and/or margin on <h1>. Reset them to get rid of the default.

If you start a new CSS, it might be a good idea to reset all padding and margins:

* {padding:0; margin:0}

Now remember this messes with e.g. <ul>'s that need some of that, so you'll end up styling them to get hem back to "normal". Les aggressive resetting can of course be done as well.

stevelibby




msg:3597737
 7:13 pm on Mar 11, 2008 (gmt 0)

that does not really solve the issue?

smallcompany




msg:3601693
 11:58 pm on Mar 15, 2008 (gmt 0)

Have you tried using Firefox and its CSS tool to see all CSS being applied to your H1 tag?

I always specifically set margin and padding for H tags.

If setting it to zero did not help, than there may be something else around your H1 tag that is making that gap.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved