I want to give my component a full page background image, but the image doesn't show up. When i check the developer console, all the css is good.
import React from "react";
import "./about.styles.scss";
const AboutPage = () => {
return (
<div className="about">
<div className="background-image">
<div className="aboutText">Some text</div>
</div>
</div>
);
};
export default AboutPage;
CSS:
.background-image {
background: url("https://i.ibb.co/TYpKc61/bg.jpg");
background-position: center center;
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
text-align: center;
position: relative;
width: 100%;
height: 100%;
text-align: center;
.aboutText {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 5rem;
}
}
Any idea how to solve this problem?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.