I got a background image for my homepage, but I can't seem to lighten the background image.
My html file looks like this:
<!DOCTYPE html>
<html>
<head>
<title> Homepage </title>
<style>
body {
background: url('static/img/background1.jpg') no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
color: #000;
font-family: 'Roboto Mono', monospace;
opacity: 0.8;
position: relative;
background-blend-mode:lighten;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1> a title </hi>
<p> some text </p>
</body>
</html>
I thought the opacity setting or the background-blend-mode would help, but this doesn't seem to work.
I also tried the following, based on a comment:
body {
font-family: 'Roboto Mono', monospace;
position: relative;
}
body :after {
opacity: 0.9;
background-img: url('static/img/background1.jpg') no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
But in this case, the background image doesn't shows at all...
This is an image of the page when I use the original setting (first set up with only body{}
):
But there is some text in it which we cannot see:
How can I lighten my background in this set up?