internet-explorer-7 - border-radius.htc 使边框变圆,但不是图像

标签 internet-explorer-7 behavior css

我正在使用 border-radius.htc ,试图在 IE7 中制作圆 Angular 。它部分工作,边框有圆 Angular ,但图像没有,导致方形图像后面有圆形边框。

<div id="container">
 <ul>
  <li>

    <img src="test.png">

  </li>
 </ul>
</div>

CSS

#container {
   position:relative;
   top: -20px;
   width:1000px;
   margin: 0 auto;
   margin-left:-10px;
}

#container li {
   float:left; 
   list-style:none; 
   margin: 0 5px; 
 }

#container ul li {
  width:180px; 
  height:200px;
}

#container ul li img {
   width:175px; 
   height:175px; 
   -webkit-border-radius: 999px;
   -moz-border-radius: 999px;
   border-radius: 999px;
   border: solid 3px #fff; 
   behavior: url(.../css/border-radius.htc);
}

最佳答案

为图片添加overflow: hidden;

#container ul li img {
   width:175px; 
   height:175px; 
   -webkit-border-radius: 999px;
   -moz-border-radius: 999px;
   border-radius: 999px;
   border: solid 3px #fff; 
   behavior: url(.../css/border-radius.htc);
   overflow: hidden; 
}

之所以必须这样做,是为了隐藏理论上从 div 溢出的图像 Angular 。

关于internet-explorer-7 - border-radius.htc 使边框变圆,但不是图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18912941/

相关文章:

ruby-on-rails - 什么样的行为应该成为测试的对象?

javascript - 修复了可滚动 div 内的标题表,具有相等的 'table head column width' 和 'content column width'

html - 替代可见性 :collapse not working on IE and Chrome

Drupal 站点中的 jQuery addClass() 函数在 IE7 中不起作用

css - 当我左右浮动 child 时,如何在 IE7 中制作容器 "shrink-wrap"?

windows - Behaviors SDK 在 Vs2017 中不可用

Emacs 下一个错误 (C-x `) 可视化

javascript - 单击触发器内的元素时如何防止 Bootstrap Modal 打开?

jquery - jQuery Megamenu 中的 IE7 z-Index 问题

javascript - css伪元素:before for IE6/7的替代解决方案