Overflow:hidden for rounded borders using css3pie in IE8?

扶醉桌前 提交于 2019-12-22 04:43:26

问题


I have this HTML:

<div id="micrositePhotoDiv">
    <img id="micrositePhoto" />
</div>

and css:

#micrositePhotoDiv {
    overflow:hidden;
    @include border-radius(10px);
    behavior: url(PIE.htc);
}

The src for the img is set programatically in javascript.

The img is set to the width of its containing div. In ie9, firefox, chrome and so on, this makes the image have rounded borders (because the corners of the image are outside the border, and there is overflow:hidden;)

In IE8, the image does not have rounded borders. The border-radius property takes effect (I can see it behind the image if I do border: solid black 1px;) but the parts of the image outside the borders are not hidden.

Is there any way around this using css, css3pie, javascript etc? Or is this not possible to achieve in IE8?


回答1:


Apply border-radius to both - div and img and it should work.



来源:https://stackoverflow.com/questions/7765434/overflowhidden-for-rounded-borders-using-css3pie-in-ie8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!