1、代碼
<!DOCTYPE html>
<html>
<head>
<style>
.uu {
position: relative;
width: 400px;
height: 300px;
}
img {
width: 100%;
height: 100%;
z-index: 1;
}
.box_right_top {
background-image: radial-gradient(circle at left bottom, transparent 50px, white 0);
position: absolute;
top: 0;
right: 0;
z-index: 2;
width: 50px;
height: 50px;
}
.box_left_top {
background-image: radial-gradient(circle at right bottom, transparent 50px, white 0);
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 50px;
height: 50px;
}
.box_right_bottom {
background-image: radial-gradient(circle at left top, transparent 50px, white 0);
position: absolute;
bottom: 0;
right: 0;
z-index: 2;
width: 50px;
height: 50px;
}
.box_left_bottom {
background-image: radial-gradient(circle at right top, transparent 50px, white 0);
position: absolute;
bottom: 0;
left: 0;
z-index: 2;
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<div class="uu">
<img src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
<div class="box_right_top"></div>
<div class="box_right_bottom"></div>
<div class="box_left_top"></div>
<div class="box_left_bottom"></div>
</div>
</body>
</html>
2、原理
使用了radial-gradient屬性
3、效果圖
文章來源:http://www.zghlxwxcb.cn/news/detail-672720.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-672720.html
到了這里,關于CSS實現(xiàn)內凹圓角,從而實現(xiàn)圓角邊框的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!