I am working on my website, I already added some images and now I want to set one background, main, which will be covered by the others, is it possible?
Entering background-image:url("myphoto.jpg")
does not work for me. any ideas? Thanks!
I am working on my website, I already added some images and now I want to set one background, main, which will be covered by the others, is it possible?
Entering background-image:url("myphoto.jpg")
does not work for me. any ideas? Thanks!
Give background class to the dive in which you want to apply background image. and give css as per below: This is how you can do:
<div class="background"></div>
and style css would be:
.background{
background: url("myphoto.jpg") no-repeat center center;
background-repeat: no-repeat;
background-size: 100% 100%;
}
body {
background: url("myphoto.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@Hiren is correct, but you need to "Locate" the desired image, fx. if we say i have my www folder wich is my main folder, i have an index.html and a sub-folder called IMG, and inside there i got myphoto.jpg
then the following should be set as the url: url("img/myphoto.jpg")
body {
background: url("https://www.qdtricks.net/wp-content/uploads/2016/05/hd-road-wallpaper.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
background: url("{{asset('staticImage/wallpapers/wall_num10.jpg')}}") no-repeat center center fixed !important;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;