gpt4 book ai didi

html - 为什么 CSS3 边框半径不适用于 webkit 浏览器(Chrome 和 Safari)上的图像?

转载 作者:太空宇宙 更新时间:2023-11-03 20:59:06 25 4
gpt4 key购买 nike

这适用于 firefox 4 和 ie9,但不适用于 chrome 或 safari。它在歌剧中也不起作用,但谁在乎呢。那么如何让它发挥作用呢?

img { width: 100px; height: 100px; border: 3px solid #fff; 

-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;

}

最佳答案

解决方法是使用 div 并将 div 的背景设置为图像。

.rounded { 
width: 100px;
height: 100px;
border: 3px solid #fff;

-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;

background: url(image.png) no-repeat;
}

关于html - 为什么 CSS3 边框半径不适用于 webkit 浏览器(Chrome 和 Safari)上的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6195472/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com