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.
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
Post a Comment