如何在DIV中设置boxshadow作为背景

问题描述 投票:0回答:1

大家好,我正在制作一张卡片,我想在 div 后面添加一个盒子阴影,就像背景一样,但是在我设置它之后,它显示了一个白色背景,如下所示: this is what i've gotand this is what i want我该如何修复它

<div className="[box-shadow:6px_-51px_182px_0px_rgba(19,52,255,0.86)]">
                    <h3 className="text-[16.6px] font-normal text-[#575757] ">
                      Vous payez
                    </h3>
                    <h1 className="text-[#000000] font-bold text-[44.28px] ">
                      7750.00 <span className="text-[32px]">MAD</span>
                    </h1>
                  </div>
html css reactjs tailwind-css
1个回答
0
投票

background-color
div
属性设置为
transparent
以确保没有背景颜色干扰阴影

.card { 
  background-color: transparent;
  box-shadow: 6px -51px 182px 0px rgba(19, 52, 255, 0.86); 
}
© www.soinside.com 2019 - 2024. All rights reserved.