CSS/HTML-InternetExplorer8的问题(边框半径、图像覆盖和填充)



在Internet Explorer中查看我的网站时遇到问题。在下面的CSS/HTML中,图像应该被勾勒出轮廓,弯曲半径,并按比例缩放。然而,IE 8不会缩放图像、弯曲拐角,也不会出现轮廓。这是jsfiddle:http://jsfiddle.net/pave4/这个页面在最新的IE(IE8)中很好,但我需要确保它也适用于旧版本的IE。

HTML:

<ul>
<li>
    <a href="/aboutme/">
    <span class="img-outline"><span class="page-img" id="aboutme"></span></span>
    <span class="page-title">About Me</span>
    </a>
</li>
</ul>

​CSS:

.page-title {
      text-align: center;
      display:block;
      text-decoration: none;
}
.img-outline {
  height: 100%;
  background: rgba(0, 0, 0, .3);
  padding: 5px;
  display: block;   
  margin-left: auto;   
  margin-right: auto;
  -webkit-border-radius: 18%;
  -moz-border-radius: 18%;
  border-radius: 18%;
}
.page-img {
  height: 100%;
  background: rgba(50, 50, 50, 1);
  background-size:115px 115px;
  background-repeat:no-repeat;
  display: block;   
  margin-left: auto;   
  margin-right: auto;
  -webkit-border-radius: 15%;
  -moz-border-radius: 15%;
  border-radius: 15%;
}
li,
li.current,
li.current:visited {
    margin-left: 1px;
    margin-right: 1px;
    width: 118px;
    height: 112px;
    display: block;
    float: left;
    position: relative;
    opacity: .6;
}
li:hover { opacity: 1; }
li .img-outline {
  width: 70px;
  height: 70px;
}
li .page-img {
    background-size:70px 70px;
}
li #aboutme {
    background-color: rgb(36, 112, 245);
    background-image: url('http://www.rasnickjewelry.com/images/uploads/900_Animals_300/901_Elephant_Head_Ring_side_R300.jpg');
}

您使用了很多IE8不支持的CSS3属性。

正如我在对您最初的问题的评论中所说,IE高达8不支持rgba颜色。由于不使用alpha通道,请改用background-color: #323232;

IE8也不支持标准的opacity属性,您需要filter: alpha(opacity=60);(percantage值不带%)。相关的可能是IE中的元素需要layout正确呈现:有很多文章涵盖了这个主题。一个好的是On Having Layout。

要了解支持哪些css属性和功能,请使用诸如When Can I use或Quirksmode 等资源

不要调整带有样式的图像的大小上传它们的确切大小,这将节省加载时间。

关于其他类似边界半径的syles,请尝试使用此工具http://css3pie.com/

最新更新