本文介绍了html 标题标签(<h1>、<h2>、<h3> 等)的默认边距是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我避免在下面的重置代码中使用默认值:
I avoid using the defaults with the reset code below:
margin:0px; and padding:0px;
例如,下面标题标签的默认边距是多少?
For example, what are the default margins for the heading tag below?
<h1>Header</h1>
推荐答案
浏览器不同,因此如果你想要一个像素完美的设计,那么实践是将这些值重置"为 0(边距和填充)并设置他们自己.
It's different regarding which browser, thus if you want a pixel-perfect design then practice is to "reset" those values to 0 (margin and padding) and set them yourself.
CSS 重置"对于前端开发人员来说很常见,我使用的一个简单示例:
"CSS reset" is very common to front-end developers, a simple example of one i use :
html,body,blockquote,code,h1,h2,h3,h4,h5,h6,p,pre{margin:0;padding:0}
button,fieldset,form,input,legend,textarea,select{margin:0;padding:0}
fieldset{border:0}
a,a *{cursor:pointer}
div{margin:0;padding:0;background-color:transparent;text-align:left}
hr,img{border:0}
applet,iframe,object{border:0;margin:0;padding:0}
button,input[type=button],input[type=image],input[type=reset],input[type=submit],label{cursor:pointer;}
ul,li{list-style:none;margin:0;padding:0;}
strong{font-weight:bold;}
em{font-style:italic;}
这篇关于html 标题标签(<h1>、<h2>、<h3> 等)的默认边距是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!