Currently, as I work on my web page using react.js
, I'm facing the challenge of implementing a full-size background. Despite my efforts, the background only occupies the size of the text within the div. Here is the snippet of code I am working with:
app.js
<div className="header">
<h1 className="title">blah blah blah</h1>
<h4 className="greeting">blah blah blah</h4>
</div>
app.css
.header {
background: url("./blah.png");
position: relative;
background-size: cover;
background-repeat: no-repeat;
outline: 0;
display: block;
text-align: center;
color: lemonchiffon;
height: 100%;
}
I have experimented by adjusting the height
to 100%
, but it only increases the image slightly. It's worth noting that the width seems fine; my main concern lies in achieving the correct height.