Code: Select all
<style>
.home-banner
{
position: relative;
/* The image used */
background-image: url('../images/banner-home.jpg');
/* Full height */
height: 83%;
/* Create the parallax scrolling effect */
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
I've seen how to do when the image is directly in the DIV, but not as a background.
And coding the background-image code into the HTML is bad-form. So is there a good way to do it?