gpt4 book ai didi

html - 投影以展开元素的整个宽度

转载 作者:行者123 更新时间:2023-11-27 22:34:54 26 4
gpt4 key购买 nike

我如何获得一个投影来扩展元素的整个宽度。这就是我现在所拥有的,但我无法在整个元素上水平传播。
正如您在图像的右侧和左侧看到的那样,阴影是插入的,我需要它跨越整个宽度。

box-shadow: 0 8px 6px -6px black;

enter image description here

最佳答案

您的负扩散半径造成了这种情况。将 -6px 更改为某个正值:

box-shadow: 0 8px 6px 6px black;

jsFiddle example

根据MDN :

Positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink. If not specified, it will be 0 (the shadow will be the same size as the element).

关于html - 投影以展开元素的整个宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14654516/

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