I designed a background-image (a water pattern with sand at the bottom) for one of my websites that has a width of 230px and a height of 1230px.
What I want is for this image to
- repeat itself horizontally to fill the whole 100% width
- but stretch itself to 100% height of the browser window.
So, what I did was
<div style="position: fixed; top: 0; height: 100%; width:100%; z-index: -100;
background-image:url(bg.jpg); background-repeat: repeat-x"> </div>
but unfortunately this does not stretch the DIV's height to the current browser window.
The only way I saw was to write a div with several IMG tags in it:
<div style="position: fixed; top: 0; height: 100%; overflow: hidden;
width: 5000px; z-index: -99" align="left">
<img src="bg.jpg" style="height:100%" alt=""/>
<img src="bg.jpg" style="height:100%" alt=""/>
<img src="bg.jpg" style="height:100%" alt=""/>....and so on...</div>
This works like intended...but this can't be the correct practice? Considering accessibility this is a nightmare, no?
Thanks for your help!