Parallax Background Images Zoomed In On Mobile View
Solution 1:
It looks like your background images are not "zoomed-in" but, in effect, "not zoomed out". The backgrounds are displayed at their actual size on screens narrower than 1024px
.
This is caused by quite a few declarations in your style.css
at lines ~480
, ~500
, ~525
and ~545
where a bunch of media queries repeatedly set the background-size
property of #home
, #divider
and #contact
elements to auto
.
You should set the background-size
property of those elements to cover
if you want the background images to be as small as possible but still cover the element.
On the other hand, setting your background-size
to cover
would conflict with your chosen parallax method. Whenever you are vertically shifting the background-position
via parallax on a background-size:cover
element, the "block of white space" you describe appears. This could be fixed using two different methods:
- Use of negative margins + paddings so the background is
zoomed-in
enough for the "white blocks" not to appear when the element is on screen - Use a different parallax method (absolutely positioned
<img>
tags or pseudo-elements that you could apply CSS transforms to).
Please note style.css
currently has a considerable amount of sub-optimal code.
And your markup also has a few notable inconsistencies like, for example, some of your sections feature the parallax-section
class while others the paralla-section
which is nowhere to be found in your CSS
.
Post a Comment for "Parallax Background Images Zoomed In On Mobile View"