What are the default margins for the html heading tags (

,

,

, etc.)?

后端 未结 4 1267
盖世英雄少女心
盖世英雄少女心 2020-11-22 13:17

I avoid using the defaults with the reset code below:

margin:0px; and padding:0px;

For example, what are the default margins for the headin

4条回答
  •  生来不讨喜
    2020-11-22 14:16

    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" 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;} 
    

提交回复
热议问题