【发布时间】:2023-01-21 00:53:08
【问题描述】:
创建了一个包含页面的文件夹,在每个页面中用于 react router,然后在 styles.css 中添加其中一个背景时,每个页面都将显示相同的背景。
我以这种方式分配了背景图像:
body {
height: 100vh;
background-image: url("../../assets/images/Brandnewlaptop.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
我想将该图像放在该页面中,在其余页面中指定不同的图像背景,但这反而使所有页面都获得了“Bradnewlaptop”背景。
【问题讨论】:
标签: css reactjs react-router background