页脚不会停留在960网格中

时间:2012-08-15 23:45:20

标签: css footer 960.gs

我正在使用960网格系统,而且我在将网页与网格以及页面底部保持一致方面遇到了麻烦。下面的代码是使用0px的margin-left和margin-right计算的,而不是在页面边缘之间的空格中自动填充。

HTML

<footer class="botbar">
    <small class="contact">name address information</small>
    <small class="social">social media icons</small>
    <small class="humans">human info</small>
    <small class="copyright">&copy; info</small>
</footer>

CSS

.botbar {
  /*properties of container_16*/
    margin-left:auto;
    margin-right:auto;
    width:960px;
  /*my styling*/
    clear: both;
    position: absolute;
    bottom: 0;}
.fcontact {
  /*properties of prefix_1*/
    padding-left:60px;
  /*properties of container_16+grid_4*/
    width:220px;
  /*properties of grid_4*/
    display:inline;
    float:left;
    margin-left:10px;
    margin-right:10px;
.social {
  /*properties of prefix_1*/
    padding-left:60px;
  /*properties of grid_4*/
    display:inline;
    float:left;
    margin-left:10px;
    margin-right:10px;
  /*properties of container_16+grid_4*/
    width:220px;
  /*properties of suffix_1*/
    padding-right:60px;}
.humans {
  /*properties of grid_4*/
    display:inline;
    float:left;
    margin-left:10px;
    margin-right:10px;
  /*properties of container_16+grid_4*/
    width:220px;
  /*properties of suffix_1*/
    padding-right:60px;}
.copyright{
  /*properties of grid_16*/
    display:inline;
    float:left;
    margin-left:10px;
    margin-right:10px;
  /*properties of container_16+grid_16*/
    width:960px;}

1 个答案:

答案 0 :(得分:0)

解决了它,能够执行.bottom类并将其添加到页脚<footer class="botbar bottom">而不需要<div>