Forum Moderators: not2easy

Message Too Old, No Replies

How to fix blank space below h1 tags

         

stevelibby

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



In your stylesheet, remove the default padding:

h1 {
padding:0;
}

dc

stevelibby

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

10+ Year Member



hi
there is not a padding in there?

pageoneresults

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

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It could be padding, margin or line-height.

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

stevelibby

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

10+ Year Member



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

swa66

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

WebmasterWorld Senior Member 10+ Year Member



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

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

10+ Year Member



that does not really solve the issue?

smallcompany

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

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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.