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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stretching images to end of page

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
US
I have a webpage where I'm showing a header image, and I would like for 2 colors (light blue and a darker blue) to show from the end of the header image to the end of the browser window. How would I go about doing this?

thanks for the help

jason
 
You can create a (one pixel high) X (width of screen) size image with your two colors and then set it as your background in the <BODY> tag.
 
I could do that, but that would only work if I knew the exact resolution the user would be viewing. I was hoping for a more dynamic solution that would work the same with a 1024 px wide screen as a 1900 px screen.
 
a nasty workaround which would achieve this would be to have a div positioned absolutely at left:0px top:0px with a very low z-index e.g 1

this div could then contain a table (urghhh) at 100% width with two cells both set to 50% width with the required colors set as background-color for the table cells using css.

your only problem then would be to make the table the height of window. height=&quot;100%&quot; may work but i have found this a bit flakey..lost of br's would do the trick i guess but this really is a nasty workaround.

you may be able to do it with css by floating divs with height 100% and width 50% side by side but again i wouldnt have thought this would work for all browsers

anyway hope you can get it working

rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top