javascript - How to fit div on responsive background -


recently, im looking way this:

i have html holds background image. image responsive / scales on resize background-size: cover; rule. in html (with position: relative rule) have div should have width, height , position cover 1 of laptops (in image top image)

the problem if use percentages or vw or vh rules, after resize element never fit 1 on laptops (on image screen 2 , 3).

so question - possible ? if yes can use every technique possible (javascript, css3) archive effect. also, div should change dimensions fit 1 of laptops.

thanks advice.enter image description here

background size 100% 100% can squash image. enter image description here

you can try using % background-size property

example:

div{    background-size:100% 100%;    background-repeat: no-repeat; } 

you can try background-attachment property

here details css3 background-size property


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -