+ 5
How to get opacity of background image?
in <style> body{background-image:url("image.jp"); } </style>
7 Réponses
+ 4
selector {
position:relative;
}
selector::before {
position: absolute;
content: "";
z-index:-1;
opacity: 0.5;
background: <path>;
top: 0;
left : 0;
}
+ 2
how to shape the image
+ 1
no size of a picture
0
Or you can apply styles to a child div
HTML:
<div class="setion">
<div class="section__background-image"></div>
</div>
CSS:
.section__background-image {
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
background-image: url('your.jpg');
background-size: cover;
opacity: 0.7;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
0
Do you mean 'background-size'?
0
Try to change percentages of 'width' and 'height' properties... For example, instead of 100% try 50% or whatever you need
0
how to use background image in html