我试图使用CSS在React Js中仅在部分的右侧和左侧应用薄阴影,但我只在一侧得到阴影。下面是代码
.MainSection{
margin-top:2%;
background-color: white;
width: 40%;
border: solid 1.5px gray;
box-shadow: -60px 0px 100px -90px #000000,60px 0px 100px -90px #000000;
}
import React from "react";
import "./MainSection.css";
function MainSection() {
return (
<div className="MainSection">
<h1>MainSection</h1>
</div>
);
}
export default MainSection;
2条答案
按热度按时间ou6hu8tu1#
您的
box-shadow
尺寸有问题。如果您更改尺寸,css
的其余部分将正常工作1l5u6lss2#
使用此添加框阴影左右两侧