gpt4 book ai didi

html - 使用 css3 居中投影,可能吗?

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

我正在尝试创建以边框为中心的投影,不想使用图像作为背景但不确定第一种方法是什么。

不要求编写代码,但如果有人能给出如何实现这一点的想法,那就太好了。

我附上一张图片以供引用,如果您注意到第一个图片的中心,有一个小阴影。 enter image description here

最佳答案

你可以使用伪元素

div {
height: 100px;
width: 100px;
border: 1px solid black;
background: white;
position: relative;
}
div:after {
content: '';
border-radius: 50%;
width: 100%;
height: 20px;
top: 80px;
left:0;
position: absolute;
box-shadow: 0px 10px 5px #888888;
z-index: -1;
}
<div></div>

关于html - 使用 css3 居中投影,可能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38082637/

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