html - Choppy scrolling in Google Chrome due to width:100% attribute -


i using different background image each page on site using html below:

<div class="bg_img"> <img src="images/bg1.jpg" alt="background" /> </div> 

when using site in ie , firefox there no problem when using in chrome there choppy / lag effect when scrolling.

i realised when remove width:100% property lag stops need scale background images.

.bg_img img{ width:100%;  <---- problem position:fixed; top:0px; left:0px; z-index:-1; } 

is there around using width:100%?

i totally change approach full page background. there better solutions setting 100% cause wrong image ratio. here's way try.

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

you can read more full page backgrounds here.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -