html标题标记(< h1>,< h2>,< h3>等)的默认边距是什么? [英] What are the default margins for the html heading tags (<h1>, <h2>, <h3>, etc.)?

查看:1223
本文介绍了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 reset对于前端开发人员来说是很常见的,一个简单的例子我使用:

"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标题标记(&lt; h1&gt;,&lt; h2&gt;,&lt; h3&gt;等)的默认边距是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆