0

我正在使用 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;}
4

1 回答 1

0

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

于 2012-08-16T18:27:21.900 回答