Responsive Background Image Css Tricks Code Example


Example 1: CSS make image fill whole background


html { 
background: url(images/bg.jpg) no-repeat
center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

Example 2: how to set background automatically with my screen height


html { 
background: url(image.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

Example 3: background: url("image/banner-image-1.jpg") no-repeat center top; background-size:cover;


-moz-backface-visibility: hidden;

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable