+ 3
How can i use a photo background in my code ?
6 odpowiedzi
+ 5
there are multiple ways to do this. One is simply using :
body {
background-img: url ("img.jpg")
}
One problem I find with this strategy sometimes, is the background is repeated. Another way to do this to make sure the image is not repeated, is this:
HTML:
<div id="image"></div>
CSS:
#image {
content: "";
position: absolute ;
left:0; top:0;
width:100%;
height: 100%;
background:url("img.jpg");
background-size:cover;
background-position:center;
user-select:none;
}
Hope this helps!!
+ 4
Riselda Rada anytime 😄
+ 2
Thank you 🙏🏻🙏🏻
+ 2
don't be sad 😶 thats awesome . i am trying . thank you very much♥️
+ 1
Use style tag in head tag like this:
<head>
<style>
Body{
background-image: url("image.jpg")
}
</style>
<head>