If I may also suggest a change to the css as you don’t want to hide overflow on the html and body and you don’t want to set fixed heights either.
I’m guessing you wanted a viewport height gradient and therefore I would use a fixed positioned pseudo element so that the gradient doesn’t stretch over the whole document but remains viewport height (otherwise the gradient will stretch forever on a long page). I would not use background-attachment:fixed for this as that doesn’t work properly on mobiles.
I would do it like this but refer to the js experts for the correct jS
(Note there were errors in your css such as this #0005bbb) . I would also lose the prefixes as they carry too much weight and complexity and are not needed for modern browsers. Just supply a solid background color for older browsers as a fallback.)
No it doesn’t as that code is something you should never use.
Don’t give a width to the html element and don’t ever float it (unless its for some convoluted demo). In the real world you do not want to give a width to the html element and you certainly don’t want to float it as that makes it content width only and not auto width (effectively 100% by default).
What you are getting in your example is a fixed width of 1400px (very bad for responsive design) and a gradient that repeats horizontally at 1400px!
Lastly, stop messing around with the html element as its more complicated than you think. Use the body for your backgrounds. There are only a few cases where you want to apply styles to the html element.
By default background styles that are applied to the body element automatically propagate to the html unless you have added backgrounds to the html element. When you add a background to the html element you effectively cut the body’s height down to content height which is not what you want 99% of the time. Just apply your backgrounds to the body element and leave the html element alone.
I didn’t see your JS but will let the jS experts comment on that aspect (but you have been given three working examples already ;))
Thank you, it’s not easy. This web page is activated by the main menu and from there I should get the menue web page another daily back color. But that is not the real problem. With the ie 8, 9 everything was easy. but with the win 10 I have 2 instances as back color. I had the style w/h without 100%. That was to get out of your hair …