Hi,
As I’m aware, best way to have two layer background is to put one background on html element and the other in body element. So html contain repeat background positioned left top, and body contains repeat-x background positioned left top. Works great on all browsers, but that’s not the case when it comes to zoom (not text resize). Assume the intended effect is striped background with gradient color variation on top.
Results on Firefox
On increase zoom + horizontal scroll: while the html element background takes up the whole scroll width, it’s not same for the body element.
On decrease zoom: works as expected.
Results on Chrome
On increase zoom + horizontal scroll: same as Firefox.
On decrease zoom: Here, when zoom is decreased from default 100% zoom, the body background is misaligned.
Results on Safari 3
On increase zoom + horizontal scroll: same as Firefox, but background doesn’t scale on both html and body element.
On decrease zoom: background doesn’t scale on both html and body element, so technically no breaking occurs, but since everything else is resized it should only be natural for this to resize too, yes?
Results on Opera
On increase zoom + horizontal scroll: same as Firefox.
On decrease zoom: same as Firefox.
Results on IE 7 (buggy zoom)
On increase zoom + horizontal scroll: here the html background doesn’t zoom, but body takes up all the scroll width unlike other browsers. Hence misaligned.
On decrease zoom: Same as increasing zoom, but body doesn’t take up all the width.
Results on IE 8
On increase zoom + horizontal scroll: Same as Chrome only when zoomed +20% (120%, 140%, 160% etc.) otherwise slightly misaligned.
On decrease zoom: Same as Chrome.
So How do I create an effect of striped background with “gradient color variation on top” that consistent across browsers + doesn’t break when zoomed (decreased or increased)?
Thanks in advance. ![]()