繁体   English   中英

IE8中的圆角图像角

[英]Rounded image corners in IE8

我有一些动态生成的图像:

<div class="image">
<?php echo "<img class='logo_client' src='img/clients/".$row['logo_name'].".jpg''>"; ?>
</div>

我希望它们具有圆角,以便在我的CSS中输入:

.image {
padding: 0;
width: 100px;
height: 100px;
overflow: hidden;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-o-border-radius: 10px; 
border-radius: 10px;    
behavior: url(css/PIE.php);
}

我可以在Firefox,Chrome和IE9中看到圆角,但是在IE8中却无法使用。 PIE已与IE8中的其他元素一起使用。

有谁知道这可能是什么?

非常感谢你

我知道在IE8及以下版本中使圆角起作用的唯一方法是使用如下代码:

<div class="image">
   <span class="tl"></span>
   <span class="tr"></span>
   <span class="br"></span>
   <span class="bl"></span>
</div>

然后像这样的CSS:

.image { position: relative; }
.tl, .tr, .br, .bl { position: absolute; }
.tl { left: 0; top: 0; width: 20px; height: 20px; background: url(/images/tl.png) no-repeat top left; }
.tr { right: 0; top: 0; width: 20px; height: 20px; background: url(/images/tr.png) no-repeat top left; }
.br { right: 0; bottom: 0; width: 20px; height: 20px; background: url(/images/br.png) no-repeat top left; }
.bl { left: 0; bottom: 0; width: 20px; height: 20px; background: url(/images/bl.png) no-repeat top left; }

其中背景图像是与该角对应的圆角的所有图像,例如,右下角的背景图像可能看起来像这样:

http://www.webcredible.co.uk/i/br2.gif

所以(希望的)

可能会有更好的方法来执行此操作,因为上述方法比较费力,而且不是特别干净。

话虽如此,我怀疑在IE8及以下版本中获得圆满成功的任何方式是否特别“干净”。 我通常只将IE8及以下版本保留为圆角,与其他浏览器相比,没有多少人甚至不再使用7和8。

编辑:

如果您是我,我会避免使用类似“行为:url(css / PIE.php);”这样的代码。 其他浏览器不支持IE行为,我认为即使Microsoft也放弃了它们。

最后,我使它可以与CSS3 PIE一起使用。 圆角出现在IE7,IE8和所有其他浏览器中。 对不起,这是一个编码错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM