简体   繁体   English

溢出隐藏在 Internet Explorer 11 中不起作用

[英]Overflow hidden is not working in Internet Explorer 11

I need to display image as round shaped in my site so i used overflow:hidden in my css code it works fine in other browsers but not in IE11.我需要在我的网站中将图像显示为圆形,所以我使用了溢出:隐藏在我的 css 代码中,它在其他浏览器中运行良好,但在 IE11 中不起作用。 这是我在 iIE11 中得到的输出

above image is the output i got in ie and my css code is上图是我在 ie 中的输出,我的 css 代码是

img-block {
/* position: relative; */
/* background-color: #f4f4f4; */
height: 200px;
overflow: hidden;
width: 100%;
text-align: center;
display: table;
font-size: 20px;

and my HTML code is我的 HTML 代码是

<div class="img-block">
        <div class="img">
                                <img src="https://samugam.s3.us-east-2.amazonaws.com/profiles/44/1521531048.jpg" alt="Shamini">
                        </div>
    </div>

Add this style添加此样式

img {
    border-radius: 50%;
}

You need to add border-radius in order to make the image a round shape.您需要添加border-radius以使图像呈圆形。

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

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