gpt4 book ai didi

css - 浏览器兼容性问题(IE 和 Firefox)

转载 作者:行者123 更新时间:2023-11-28 12:54:29 26 4
gpt4 key购买 nike

我正在努力使我的网站 ( http://www.arcdna.com ) 与 Firefox 和 Internet Explorer 兼容。有两个主要问题导致了最大的问题。

  1. 不会显示视差图像。
  2. 页脚不会显示。

对于视差图像,我使用 (background-image:cover;) 作为显示图像的代码;但是,通过研究,我相信这就是导致问题的原因。我不确定解决此问题的替代方法。

对于页脚,我使用了一个简单的页脚元素;但是,链接都未对齐,并且缺少背景颜色。

如有任何建议,我们将不胜感激!

最佳答案

对于 IE 兼容性你可以试试这个 IE6+方法一【jquery】

<img src="images/bg.jpg" id="bg" alt="">
#bg { position: fixed; top: 0; left: 0; }
.bgwidth { width: 100%; }
.bgheight { height: 100%; }

JQUERY

    $(window).load(function() {    

var theWindow = $(window),
$bg = $("#bg"),
aspectRatio = $bg.width() / $bg.height();

function resizeBg() {

if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
$bg
.removeClass()
.addClass('bgheight');
} else {
$bg
.removeClass()
.addClass('bgwidth');
}

}

theWindow.resize(resizeBg).trigger("resize");

});

方法 - 2 : (CSS) IE8+

<div id="bg">
<img src="images/bg.jpg" alt="">
</div>
#bg {
position: fixed;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
}
#bg img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
min-width: 50%;
min-height: 50%;
}

希望这可以成为更好的封面替代品。对于页脚,无法理解您的意思。

关于css - 浏览器兼容性问题(IE 和 Firefox),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16655435/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com