How to remove padding/margin on h tags?
I'm 99% sure I'm not overlooking something here. I have the usual r开发者_如何学Goesets done, no margin or padding on the h tag, line-height:100% etc etc. but STILL there are about 2 or 3px padding above and below the h tags. It's the same on most major sites, so I'm guessing it's prob unavoidable? It may seem like a moot point, but it's SLIGHTLY messing up my alignment.
So is there some unavoidable issue where all fonts have slight padding around them no matter what you do?
Don't forget implicit line breaks that can add "silent" space to layouts:
<h1>blah blah</h1>[space character here due to line break]
<h1>blah blah</h1>
would need to be:
<h1>blah blah</h1><h1>blah blah</h1>
Here you go:
HTML
<div id="blah"> <div style="width:300px; margin:0px auto 0px auto;"><h1 style="color:#000000;font-size:12px; display:inline">This is my heading</h1></div> </div>
CSS
#blah
{
height:50px;
width:100%;
background-color:#B40700;
}
精彩评论