I am currently making a web page (using react.js
) and I am attempting to implement a background. I would like the background to be its full size, however it is only the size of the text inside of the div with it.
Here is the code I am currently using:
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 tried adjusting the height
to 100%
, however it only makes the image slightly larger. I would also like to say that the width is correct, my only issue is with getting the height to be proper.