簡體   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