不需要的边距与css [英] unwanted margin with css

查看:146
本文介绍了不需要的边距与css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个相当简单的网页上工作,我有点灰尘,所以我可能犯了一个明显的错误,但请坚持我。我的文档的边上有一个非常薄(可能是5-10px)的边距。我包括我的代码的缩写版本。任何人都可以告诉我为什么会得到它和如何摆脱它。

I'm working on a fairly simple webpage and I'm a little bit dusty so I could've made a really obvious mistake but please stick with me. I'm getting a very thin (maybe 5-10px) margin on all sides of my document. I'm including an abbreviated version of my code. Can anyone tell me why I'm getting it and how to get rid of it.

html:

<body>
<div id="wrap">
<div id="video">
</div>
<div id="para">
<p>Hello, I'm ...</p>
</div>
<div id="footer">
<ul id="social">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</body>

css:

#wrap { background: url(Andres/images/background-bg.png);  margin: 0 auto;
 }

#para p { padding: 20px; }

#footer { background:url(Andres/images/footer.png); height: 80px;}

#footer #social li { float: left; padding: 10px; list-style: none; }


推荐答案

$ c>< body> 元素 - 大多数浏览器在所有方面都包含8像素,只需添加:

Its likely the default margin on the <body> element - most browsers include 8px on all sides, just add:

body {
margin: 0;
}

这篇关于不需要的边距与css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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