nav li a.home { background:url('../img/custom_icons/home.png') no-repeat center; background-size: 30px 30px; background-position: 0px -1px;}
nav li a.contact { background:url('../img/custom_icons/email.png') no-repeat center; background-size: 32px 35px; background-position: 0px -1px; }
nav li a.show_all { background:url('../img/custom_icons/slide.png') no-repeat center; background-size: 35px 50px; background-position: -5px -10px; }
#facebook {
background: url(../img/custom_icons/facebook.png) no-repeat;
background-size:30px 30px;
}
#sina {
background: url(../img/custom_icons/sina.png) no-repeat;
background-size:30px 30px;
}
我发现 chrome/fx 或其他浏览器中的那些背景图像位置完美,但在 IE 8 中不是,它太小/太大或者只是移动到其他地方。如何解决问题并同样工作作为其他浏览器?谢谢
已更新:添加 ms 过滤器后,仍然不起作用?
nav li a.home { background:url('../img/custom_icons/home.png') no-repeat center; background-size: 30px 30px; background-position: 0px -1px;}
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='../img/custom_icons/home.png',
sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='../img/custom_icons/home.png',
sizingMethod='scale')";
这是添加建议过滤器后的 css 文件。但是,它仍然不起作用?这样放置代码是否正确?这看起来很奇怪,因为有一个;最后还有一个 "after ='scale') 。谢谢
最佳答案
“背景大小”在 IE8 上不工作。
关于html - 背景图像在 IE 8 中的位置不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14514288/