tags:

views:

33

answers:

3

Hi all, I have a basic question... When you have a html page with a scrollbar, the size of the body element remains equal to the window size, not to the effective width of the page inside the window... why? Is there a way to modify this behaviour?

+1  A: 

I think this only happens if you float the contents inside the body, and do not predict for expansion of the container..

If you care to show some code, we might be able to tell you exactly why it happens in your case..

Gaby
it happens also in this page
Clare
A: 

I'm not sure what you're asking, but I believe you want NO SCROLLBARS, am I right?

If so, then put this in your CSS

html, body {
  margin: 0px;
  padding: 0px;
  width: {whatever width you want}
}
Zane Edward Dockery
Uhhhhhh, what?!
Josh Stodola
A: 

No, having the scrollbar is not a problem... What I said happens also in this site... if you put a right border to the "body" element and resize the page to have a scrollbar, you'll see that the border cuts the page... because the body element has the width of the window...

Clare