HTML5页脚-无法删除的边距 [英] HTML5 footer - margin that I can't remove

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

问题描述

我已经建立了一个基于HTML 5 Boilerplate的网站,我想要一个基本上全白色的网站,但页脚为灰色背景.问题是页脚下方有一个边距(并且很确定这是一个没有填充或白色边框的边距),而我的灰色页脚下面却留有白色条带.

I've started a site based on HTML 5 Boilerplate and I want a basically all white site but a grey background to my footer. Problem is that there is a margin (and pretty sure it's a margin not padding or white border) below the footer leaving a white strip below my grey footer.

为了将内容发布到这里,我将所有内容都删减了,并内联移动了CSS,并更改了颜色以使其更明显;

I've cut everything down in order to post here and moved my CSS inline, plus changed the colours to make it more visable;

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body style="background:#C0C0C0;">
    <img src="1by1.gif" width="700" height="1000" border="0" alt="">
        <div style="border-top: 1px solid #666366;background:#FFFF33;">
            <footer style=" max-width: 1200px; margin: 0 auto;">
                footer
            </footer>
       </div>
    </body>
</html>

,它是在此处在线

谢谢,凯文

推荐答案

您可以使用:

body {
    margin:0;
}

或者(更好)在页面中包含 normalize.css .

Or (better) include normalize.css in your page.

这篇关于HTML5页脚-无法删除的边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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