我是网络开发新手,在删除正文边距时遇到了问题。
There's space between the very top of the browser and "logo" text. And my code is here on jsbin http://jsbin.com/suzipe/1/edit?html,output.
Is body { margin: 0;}
如果我想删除空格,这是错误的吗?
我想说,使用全局重置是解决这个问题的一个糟糕方法。
* {
margin: 0;
padding: 0;
}
h1边距从父级弹出的原因是父级没有填充。
如果向 h1 的父元素添加填充,则边距将位于父元素内部。
重置allpaddings 和 margins 为 0 会导致很多副作用。那么最好删除这个特定标题的页边距。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)