Ronnie Overby
Ronnie Overby

Reputation: 46470

Div Width Problem

What keeps a div from extending horizontally past the edge of the screen when there are horizontal scroll bars?

The DIV's content will overflow out to the left but not the DIV itself.

What can make the div go all the way to the right?

Thanks

Upvotes: 0

Views: 474

Answers (3)

Steve Perks
Steve Perks

Reputation: 5530

For the div to expand out of the view pane you need it to have a width. If it doesn't have a width then it takes the width of it's container. When content is bigger than it's container (the div or body, etc.) then it behaves according to overflow, the default being visible.

options are:

overflow: visible;
overflow: hidden;
overflow: auto;
overflow: scroll;

http://www.w3schools.com/Css/pr_pos_overflow.asp

Upvotes: 1

John Boker
John Boker

Reputation: 83699

see if adding the clearfix class solves your problem, here's some information:

http://www.webtoolkit.info/css-clearfix.html

Upvotes: 0

Tommi Forsström
Tommi Forsström

Reputation: 1467

I'm not sure I completely understand your question, but I'd look into the CSS overflow-declaration: http://www.quirksmode.org/css/overflow.html

Upvotes: 0

Related Questions