简体   繁体   English

IE8中的圆角图像角

[英]Rounded image corners in IE8

I have a few images generated dynamicaly : 我有一些动态生成的图像:

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

And I would like them to have rounded corner so that in my CSS I put : 我希望它们具有圆角,以便在我的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);
}

I can see the rounded corners in Firefox, Chrome and IE9 but it's not working in IE8. 我可以在Firefox,Chrome和IE9中看到圆角,但是在IE8中却无法使用。 The PIE thing is already working with other elements in IE8. PIE已与IE8中的其他元素一起使用。

Does anyone know what it could be ? 有谁知道这可能是什么?

Thank you very much 非常感谢你

The only way I know of making rounded corners work in IE8 and below is with code like this: 我知道在IE8及以下版本中使圆角起作用的唯一方法是使用如下代码:

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

and then with CSS like this: 然后像这样的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; }

where the background images are all images of rounded corners corresponding to that corner, eg the bottom right hand corner background image might look like this: 其中背景图像是与该角对应的圆角的所有图像,例如,右下角的背景图像可能看起来像这样:

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

and so one (hope that makes sense) 所以(希望的)

There might be nicer ways to do this, as the above method is a bit laborious, and not particularly clean. 可能会有更好的方法来执行此操作,因为上述方法比较费力,而且不是特别干净。

Saying that, I doubt any ways of getting rounded corners to work in IE8 and below will be particularly "clean". 话虽如此,我怀疑在IE8及以下版本中获得圆满成功的任何方式是否特别“干净”。 I usually just leave IE8 and below without rounded corners, not that many people even use 7 and 8 anymore in comparison to other browsers. 我通常只将IE8及以下版本保留为圆角,与其他浏览器相比,没有多少人甚至不再使用7和8。

EDIT: 编辑:

If I were you I'd steer well clear of code like this "behavior: url(css/PIE.php);" 如果您是我,我会避免使用类似“行为:url(css / PIE.php);”这样的代码。 IE behaviours are not supported in other browsers, I think even Microsoft gave up on them. 其他浏览器不支持IE行为,我认为即使Microsoft也放弃了它们。

Finaly I made it work with CSS3 PIE. 最后,我使它可以与CSS3 PIE一起使用。 Rounded corners appear appear in IE7, IE8 and all other browsers. 圆角出现在IE7,IE8和所有其他浏览器中。 It was a coding mistake, sorry. 对不起,这是一个编码错误。

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

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