Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background Stretching Issue

Status
Not open for further replies.

dappster

Programmer
Aug 7, 2006
4
GB
Hi dudes\dudets

im have a few problems trying to find an effective way to get my pages to automatically stretch to window size without tiling. Ive tried using layers but that seems to mis-align my text when view in firefox or opera. Need a more universal solutiuon. I Tried a few home brewed scripts but they only seem to resize images rather than background or they just rezise the window wich i dont want.

Please advise?? Thanks
 
By layering do you mean using div and playing with the z-index? Something like this?
Code:
<body>
<!-- this creates the background image -->
<div style="z-index:0; width:100%; height:100%; left:0px; top:0px; position:absolute;">
<img src="images/cup1976.JPG" style="width: 100%; height: 100%;" width="445" height="597">
</div>

<!-- this puts the contents of the page on top of the background image -->
<div style="z-index: 1; position: absolute;">
This is a test.
</div>
This is outside the div and never appears because it is blatted by the div

</body>
 
See thats exactly what i have been using for a temp solution but when it comes to the more complex pages it creates page layout problems. Isnt there some form of script for example in javascript or php that can check users window size and match it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top