amitabhaghosh197
8/28/2015 - 6:32 AM

Best way to write background attachment fixed

Best way to write background attachment fixed

Reff: https://teamtreehouse.com/community/fixed-background-not-working-in-chrome
http://stackoverflow.com/questions/20268962/fixed-attachment-background-image-flicker-disappear-in-chrome-when-coupled-with
.element{
 background:url('image_path') no-repeat 0 0 fixed;
 position: static; /* This is important to avoid Chrome error*/

    overflow: hidden;   
    padding: 50px 0;
    background-size: cover;
     -webkit-background-size: cover;
    -moz-background-size: cover;

}