What are the default margins for the html heading tags (

,

,

, etc.)?

后端 未结 4 1248
盖世英雄少女心
盖世英雄少女心 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:18

    Your Question:

    It varies between browsers. Check each browser's specific default stylesheets to tell.

    For Google Chrome for example, it's 0.67em.


    A Better Solution?

    Do know that if you wish to aim for x-browser consistency, you'll have to use a CSS Reset.

    The most common one being:

    * { padding: 0; margin: 0; }
    

    Although other (and probably better) exist.

提交回复
热议问题