gpt4 book ai didi

html - 我可以在伪选择器图像之前或之后放置边框半径吗?

转载 作者:太空狗 更新时间:2023-10-29 15:44:55 24 4
gpt4 key购买 nike

当我将图像 url() 放入 content:'' 属性时,有什么方法可以在 :before 或 :after 上获得边框半径?

最佳答案

是的,你可以在伪元素 ::after, ::before 中使用 border-radius 和背景图片:

div:before {
content: "";
display: block;
width: 200px;
height: 100px;
background-image: url(http://placehold.it/200x100);
border-radius: 10px;
}
<div></div>

关于html - 我可以在伪选择器图像之前或之后放置边框半径吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28883889/

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