如何清除页面左侧和右侧的空白区域? [英] How to remove white space left and right side of page?

查看:1160
本文介绍了如何清除页面左侧和右侧的空白区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个页脚,但左右两侧显示一些空白。如何清除空格?

I am trying to make a footer, but the left and right sides show some white space. How to remove the white space?

这是我的代码:

<html>
<head>
  <style>
footer {
  background: none repeat scroll 0% 0% #DFDFDE;
  padding: 120px 0px;
  text-align: center;
  position: relative;
}
.divider {
  background: url('http://evablackdesign.com/wp-content/themes/ebd/images/footer-border.png')
  repeat-x scroll center center transparent;
  height: 7px;
  width: 100%;
  position: absolute;
  top: -6px;
}
.container {
  width: 930px;
  margin: 0px auto;
}
</style>
</head>
<body>
  <footer>
    <div class="divider"></div>
    <div class="container">
      <h1>hiiiiiiiii</h1>
      <br>
      <h2>buyyyyyyyyyyyy</h2>
    </div>
  </footer>
</body>
</html>


页脚图片

标签定义文档或栏目的页脚。

The tag defines a footer for a document or section.

元素应包含其包含元素的信息。

A element should contain information about its containing element.

页脚通常包含文档的作者,版权信息,使用条款的链接,联系信息等。 / p>

A footer typically contains the author of the document, copyright information, links to terms of use, contact information, etc.

推荐答案

正文有一个默认边距。删除它:

The body has a default margin. Remove it via:

html,body {
    margin:0;
    padding:0;
}

这篇关于如何清除页面左侧和右侧的空白区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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