How do I use CSS to repeat a first background image both vertically and horizontally, and repeat a second background image just horizontally? I wish it not to be dependent upon CSS3.
I tried the following, but no success.
body {
font-family:Verdana, Geneva, sans-serif;
position:relative;
z-index:1;
}
body:before,
body:after {
position:absolute;
z-index:-1;
top:0;
left:0;
right:0;
bottom:0;
}
body:after {
background-image:url('../images/bg.png');
background-repeat:repeat;
}
body:before {
background-image:url('../images/top-bg.png');
background-repeat:repeat-x;
}
Have a look at CSS3 multiple backgrounds. Supported since Firefox 3.6, Safari 1.3, Chrome 10, Opera 10.50 and Internet Explorer 9.0.
If you must support IE8 or earlier (noting that Google drop support for IE8 from next month), either combine the images into 1, or overlay multiple elements.
This may be one of various solutions available.