0
Background-image/color full width!
Hello guys,...I would like to achieve full background image/color on my website using <div> element. i want it to be full in that it fits the white parent background color... kindly the CSS code ?
2 ответов
0
do you mean that the width and/or height are as big as the screen?
then use width:100vw and height:100vh
0
<div> </div>
div{
background-color: green;
background-image: url("image.png");
}
or
<div><img src="image.png"/></div>
div{
background-color: green;
}
img{
width: 100%;
object-fit: fill;
}