How can I remove space (margin) above HTML header?

后端 未结 8 1900
栀梦
栀梦 2020-11-29 05:01

I am creating a website.

I have written the HTML part and now I am writing the stylesheet. But there is always some space above my header. How can I remove it?

8条回答
  •  -上瘾入骨i
    2020-11-29 05:13

    It is probably the h1 tag causing the problem. Applying margin: 0; should fix the problem.

    But you should use a CSS reset for every new project to eliminate browser consistencies and problems like yours. Probably the most famous one is Eric Meyer's: http://meyerweb.com/eric/tools/css/reset/

提交回复
热议问题