Roger Roger - 1 year ago 91
CSS Question

Buggy Responsive CSS website

  1. Portrait mode on Iphone 7

  1. Landscape Mode:

  1. Rotating back to portrait mode:

Q: Why is this occurring? What can i do to fix this buggy responsive
? Background is using WRAPPER tag while form is by using materialize
Or should i make it just like this for mobile view? :


Answer Source

The issue in the landscape screenshot appears to be that it has zoomed in by changing orientation and then you have scrolled the page.

The wrapper element is currently only set to be the height of the body/html element. Which is the height of the window, not the document. That is why the background is being clipped once you scroll any further than the height of the window.

This demo might make what's happening clearer.

To fix this you could try put the background on the body instead and adjust the height of html and body elements, like so.

html {
    height: 100%;
body {
    background-image: linear-gradient(to right, #054f7d, #00a7cf, #efe348, #861a54, #054f7d);
    background-size: 600%;
    background-position: 0 0;
    box-shadow: inset 0 0 5em rgba(0, 0, 0, 0.5);

    /* Animation */
    animation-duration: 20s;
    animation-iteration-count: infinite;
    animation-name: gradients;

I noticed also that you are using media queries, you may want to consider adding this meta tag to the head in your html

<meta name="viewport" content="width=device-width, initial-scale=1">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download