0

这不会发生在 chrome 或 ie 中。相反,Firefox 在我的页脚后添加了 50px。使用分析元素和萤火虫,它表明该空间在 html 标记之外。这是链接: http: //www.sociallab.ro/index_romana 谢谢!

html:

<html>
 <body>
  <div id="main">
  </div>
  <footer>
    <a href="http://www.messagelab.ro" target="_blank"><div class="message_lab"><img src="images/logo_mic.png" alt="Tineret in Actiune"/></div></a>
  </footer>
 </body>
</html>

CSS:

html{ 
 margin: 0;
 padding: 0;
}
footer{position:relative; 
 top: -50px; 
width:1060px; 
height:50px; 
overflow:hidden;
text-align: center;
margin:0 auto;
padding:0;}
body{
     margin-top:0px;
     margin:0 auto;
     padding:0;
     text-align: center;
     height: 1950px !important; 
background:url(../images/bg.png) left top repeat; }
4

2 回答 2

3

一些东西:

  1. <div>标签内不应该有<a>标签。
  2. 有一个heightforbody#wrap
  3. 对于footer,请删除 并将其top: -50px;替换为否定margin的 as margin-top: -50px;

使页脚链接居中对齐

不使用 div,使用这种方式:

<footer>
    <a target="_blank" href="http://www.messagelab.ro">
        <img alt="Tineret in Actiune" src="images/logo_mic.png">
    </a>
</footer>

和 CSS:

footer a {display: block; text-align: center;}
于 2012-09-30T14:25:31.077 回答
2

使用top:-50px,在页脚使用margin-top:-50px,问题就解决了。

于 2012-09-30T14:24:00.583 回答