4 replies [Last post]
KSquared
Offline
Enthusiast
Raleigh, NC
Last seen: 12 years 32 weeks ago
Raleigh, NC
Joined: 2005-10-28
Posts: 86
Points: 0

Hello Everyone,

Im having an issue with IE and my bg image. I have a small slice of a bg gradient and would like the image to stretch its height to 100% of the browser height.

I have a div set to:
div#holdBg{ width: 100%; height: 100%; left: 0px; top: 0px; position: absolute; z-index: 0;}

In FF, the height is 100% of the browser height. However, in IE the page scrolls on for a long while, even though there is no content yet.
I dont really want to use max-height because the client will be adding content so Im not sure what the max-height would be for certain pages.

You can check here to see the issue:
http://www.geneva-scientific.com/index.htm

Just wondering if there is a better way to do this?

Thanks,

Keith

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 4 weeks 4 days ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Put your background image on

Put your background image on the body element where it belongs. Forget the absolute positioning and the Z-index stuff. Using a separate DIV to do nothing but hold a background image is just a waste of code.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

KSquared
Offline
Enthusiast
Raleigh, NC
Last seen: 12 years 32 weeks ago
Raleigh, NC
Joined: 2005-10-28
Posts: 86
Points: 0

Thanks for the reply Ed,

Thanks for the reply Ed, however, this does not solve my problem of having the bg image stretch to 100% browser height. Seeing every page has different amounts of content I need to be sure the bg gradient stretches the length of the browser.

Keith

nemof
nemof's picture
Offline
newbie
Last seen: 12 years 29 weeks ago
Joined: 2006-09-03
Posts: 5
Points: 0

css2 doesn't support

css2 doesn't support resizing background images, css3 will do (not yet though obviously!).

here is something you can do

http://www.markschenk.com/cssexp/background/index.html

which achieves a similar effect to what you want, but it's not a great solution.

KSquared
Offline
Enthusiast
Raleigh, NC
Last seen: 12 years 32 weeks ago
Raleigh, NC
Joined: 2005-10-28
Posts: 86
Points: 0

Thanks for the link... Ill

Thanks for the link... Ill work on it.

Keith