gpt4 book ai didi

css - IE Logo 放置问题

转载 作者:太空宇宙 更新时间:2023-11-03 18:10:46 24 4
gpt4 key购买 nike

我在 IE 中遇到了 Vis-a-vis 的 Logo 放置问题网站。 Logo 在除 IE 之外的所有浏览器中看起来都很好。所以,我尝试了下面的代码来修复,但没有运气。期待获得最佳解决方案。

<!--[if !IE]><!-->
<style>
div.logo img {
margin-left:28%;
}
</style>
<!--<![endif]-->

<!--[if IE]><!-->
<style>
div.logo img {
margin-left:10%;
}
</style>
<!--<![endif]-->

谢谢

最佳答案

有些东西在 Internet Explorer 中呈现不正确(不确定原因)。因此,请尝试增加 .wrap 类的大小并稍微增加 Logo 的左边距。

新 CSS:

div.logo img {
margin-top: -10% !important;
margin-left: 29% !important;
background-image: url(img/logo-bg.png);
background-repeat: no-repeat;
background-size: cover;
padding: 45px 59px;
background-position: center center;
}

div.wrap {
max-width: 916px;
margin: 0 auto;
}

编辑:

READ HERE. 使用条件语句(就像您所做的那样)针对 IE10 及更高版本将不起作用。无法通过此方法访问针对 IE9 及以下版本的浏览器。要针对 IE10 及更高版本,您必须使用 Javascript/jQuery 或特定的 CSS 媒体查询,如下所示:

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {  
div.logo img {
margin-top: -10% !important;
margin-left: 29% !important;
background-image: url(img/logo-bg.png);
background-repeat: no-repeat;
background-size: cover;
padding: 45px 59px;
background-position: center center;
}

div.wrap {
max-width: 916px;
margin: 0 auto;
}
}

关于css - IE Logo 放置问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23773640/

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