# Containing Divs within a Parent Div



## smooth (Sep 26, 2005)

Hi everybody 

I have a simple example html page to test this with:


```
Untitled Document

	left
	center
	right
```
Now, if you run this page, you'll see that everything is lined up pretty well, but when make the browser thinner, the center div ends up going outside of it's container div.

I was wondering is there a way to keep fixed width divs within their container?

Any help is greatly appreciated


----------



## tomdkat (May 6, 2006)

smooth said:


> I was wondering is there a way to keep fixed width divs within their container?


There sure is. Make sure the fixed width DIV is contained within a DIV that is guaranteed to be as wide as the fixed width DIV. 

You could use the min-width CSS attribute to control the width of the parent DIV (so it won't be more narrow than the fixed width child DIV) but IE doesn't support min-width (at least pre-IE8 versions don't and I don't know about IE8). *Sigh*

Peace...


----------



## colinsp (Sep 5, 2007)

I know pre IE8 browsers that don't support min-height actually treat height as a minimum so maybe they do the same for width? Worth a try with some IE specific CSS?


----------

