Firefox和Chrome上的Div空间看起来不同(和localhost甚至不同)

时间:2018-03-29 14:19:32

标签: html css

我无法弄清楚为什么我的网页div在Firefox和Chrome(以及Edge)上有不同的空格。此外,当我在localhost上打开它时,它更加移动,所以我必须移动我的div而不是我在localhost上看到的。

该部分位于一个名为" press2"它看起来像这个

.press2  {
        margin-left:220px;
        position:absolute;
        top:1000px;
        width:580px;
}

" top"部分是我必须编辑的。当我查看localhost(Wampserver)上的页面时,它仍然距离大约100px,并与其上方的评论div重叠

.review  {
        margin-left:270px;
        position:absolute;
        top:550px;
        width:400px;
}

任何人都可以帮我解决这个问题吗?

screenshots

1 个答案:

答案 0 :(得分:1)

只需在身体中使用行高

body{
  font-family: Arial;
  font-size: 10pt;
  text-align: left;
  line-height: 12pt;
}