gpt4 book ai didi

html - 边框上的框阴影

转载 作者:搜寻专家 更新时间:2023-10-31 08:18:43 25 4
gpt4 key购买 nike

我有一个问题,我想要一个边框和一个框阴影,但阴影必须在边框之上。

box-shadow 属性在边框结束时开始,是否可以将其移过边框?

.border
{
border: solid rgba(128,42,42,.98) 16px;
}


.img-box-shadow
{
-moz-box-shadow: 0px 0px 20px #000000;
-webkit-box-shadow: 0px 0px 20px #000000;
box-shadow: 0px 0px 20px #000000;
}

我的 HTML:

<img class="border img-box-shadow" src="img.png">

已经尝试在我的盒子阴影中插入,但没有成功!

我正在寻找这种效果:

border

我得到了这个结果:

shadow in border

最佳答案

我认为使用两个重叠的框阴影会更容易实现这一点

东西 like this接近你正在寻找的东西

box-shadow: 0 0 20px 5px #000000,
0 0 0 16px rgba(128,42,42,.98);

关于html - 边框上的框阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21897866/

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