html - firefox 在页脚标签后添加空格

标签 html css firefox footer

这不会发生在 chrome 或 ie 中。 Firefox 在我的页脚后添加了 50px。使用 analyze element 和 firebug 显示该空间在 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; }

最佳答案

一些事情:

  1. 不应该有 <div>标签内 <a>标签。
  2. 有一个height对于 body#wrap .
  3. 对于 footer , 请删除 top: -50px;并将其替换为否定 margin作为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;}

关于html - firefox 在页脚标签后添加空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12661901/

相关文章:

javascript - 如何根据 HTML5 视频元素的行为控制 Bootstrap 轮播的行为?

jquery - 如何从 BODY 元素的特定类定位 HTML 元素

javascript - toFixed() 替换函数

javascript - ckeditor.js 中的 Internet Explorer 11 语法错误

html - 为什么这里没有显示背景图片?

javascript - 带有文本的光滑 slider 轮播

javascript - 如何解决从带有网格的 scrollmagic 生成的 <div> 的问题?

html - 需要帮助找到哪个 div element.style 归因于

html - 如何在 Firefox 中禁用 Html 表 native 选择

javascript - JSON.parse 问题