【问题标题】:My website is on the left top corner of the browser only on FF我的网站仅在 FF 浏览器的左上角
【发布时间】:2013-05-26 11:13:08
【问题描述】:

我一直在尝试修复我的网站在不同浏览器上的显示方式,我终于在 IEGoogle Chrome 上实现了这一点,但它在 Mozilla Firefox 上被毁了,它一直出现在左上角浏览器,因为我将每个主要的 div 设置为绝对值,即使我为每个主设置了包含图像的必要高度,并且我将每个 <div> 的宽度设置为 100%
这是代码的副本:

#headerofhome {
background-image: url(images/home/homepage_header.jpg);
background-repeat: no-repeat;
height: 95px;
width: 100%;
position: absolute;
top: 0;
left: 0;
}

#container {
background-color: #FFFFFF;
height: 497px;
width: 100%;
background-image: url(images/home/homepage_container.jpg);
background-repeat: no-repeat;
position: absolute;
left: 0;
top: 95px;
margin: 0px;
padding: 0px;
background-attachment: scroll;
}

.footer {
background-image: url(images/home/homepage_footer.jpg);
background-repeat: no-repeat;
height: 72px;
width: 100%;
position: absolute;
left: 0px;
top: 592px;
}

【问题讨论】:

  • 如果你有绝对位置和top:0;左:0;它会出现在左上角。这是预期的行为。您是否尝试将网站置于页面中间?
  • 研究使用margin: 0 auto
  • 您没有碰巧在某处拥有该网站的实时版本吗?

标签: html css firefox


【解决方案1】:

rightbottomlefttop 一起使用,您将获得所需的结果=)

【讨论】:

    猜你喜欢
    • 2012-08-19
    • 2016-11-18
    • 2020-10-03
    • 2016-04-20
    • 2018-04-11
    • 2018-03-14
    • 2021-09-14
    • 1970-01-01
    • 2021-07-04
    相关资源
    最近更新 更多