PDA

View Full Version : Div does not span 100% width when horizontal scrolling


rlemon
06-06-2005, 08:27 PM
http://www.rlemon.com/new_sites/rlemon/

The div tags for the background colour are not spanning the entire width when the user has to scroll horizontally.

to see:

1) load the site
2) resize the browser window such that the user must scroll horizontally.
3) Scroll to the right
*Notice the whitespace
4) resize the browser window so the user does not have to scroll horizontally.
*No whitespace.


i'm new to css layouts. I generally work with tables but have been told to use css and divs.

I know there is still some sloppy css there so please bare with me.

Edit:

ohh and '_padding-left' is not a valid property (according to w3c). I got it from a tutorial on how to make 'hack' IE only css. (it worked, so i kept it)

I changed that to conditional code.
<!--[if IE]>
<style>
#top_menu {
padding-left: 75px;
}
</style>
<![endif]-->

JamieR
06-06-2005, 08:34 PM
Firefox can't find www.rlemon.com :confused:

its working now

rlemon
06-06-2005, 08:48 PM
Firefox can't find www.rlemon.com :confused:

its working now

Happens to me sometimes.
few things i've noticed when attempting to connect to rlemon.com

1) sometimes 'rlemon.com' in the browser tries to direct me to spaces.msn.com/space/rlemon/

but if i type in http://www.rlemon.com it works

2) sometimes i get 'rlemon.com cannot be found'

There is no fix to this. I just try again and sometimes it works.

I've contacted my host about this, he says he doens't know whats wrong. I'm the only domain with these problems :confused:

_Aerospace_Eng_
06-06-2005, 09:09 PM
If you tell a div to be 100% width it does just that 100% of the browser window, not the width of the whole site. Fake it. Use a background image in the body to make it look like the div is expanding.

rlemon
06-06-2005, 09:43 PM
hrmm,

i didn't know that.

Tables, assigning 100% will be 100% of the site. not the clientBrowser settings.

so, what i'm trying to do now is:

if the document.body.clentWidth falls below 599px then I want to change the css to 600px for those divs.
and if it's > 600px set it to 100%?


sound like it will work (in theory?)

_Aerospace_Eng_
06-07-2005, 12:26 AM
It might work, but for IE only, Netscape and FF use window.innerWidth

rlemon
06-07-2005, 03:11 PM
document.width works as well (for FF, Mozilla, and NS) ;)