gpt4 book ai didi

CSS 阴影作为图像

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

我有这3个盒子

enter image description here

它们的构造方式如下:

    <ul class="home_boxs">
<li class="home_box light_blue">
<div class="news clearfix"></div>
</li>
<li class="home_box blue">
<div class="news clearfix"></div>
</li>
<li class="home_box dark_blue">
<div class="news clearfix"></div>
</li>
</ul>

我现在要做的是在每个框下方添加一个小阴影图像(自定义 png)。实现这一目标的最佳方式是什么?一些建议将不胜感激。

查看示例:

enter image description here

最佳答案

你可以这样做:

ul {
list-style: none;
}
li {
float: left;
}
.home_box {
position: relative;
width: 150px; /* to change with your size */
height: 100px;
/* To add more styling according to your needs */
}
.home_box:before {
content:' ';
position: absolute;
width: 100%;
height: 10px;
background: url(//placehold.it/150x10); /* placeholder */
border-radius: 50%;
bottom: -20px;
}

或者,如果您不想使用图片:

.home_box:before {
content:' ';
position: absolute;
width: 100%;
height: 10px;
background-color: #999999;
border-radius: 50%;
bottom: -20px;
box-shadow: 0 0 10px #999999;
}

Example带图片 - Example无图

关于CSS 阴影作为图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15859577/

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