# Dynamic Height



## mwdesign (Aug 20, 2010)

Hi guys,

i have an issue with using height:auto on a series of devs which will have different amount of content. What i need is for my divs to retain the margins in between them and just shift down when necessary (currently they move below the following div), I have tried using position relative on all the divs but that didnt work.

Ive attatched a jpeg explaining the problem

thanks 


```
.slider_wrapper
{
	width:355px; height:auto; float:left; padding:10px 0 0 0px; margin-bottom:0px; margin-left:18px; margin-top:15px; background:#f5f5f5; border:1px solid #ddd;
}
[CODE]

[HTML]

				[URL=#]Majority in UK motorist poll put off 'complicated' claims process[/URL]

       
    		[LIST]
        		[*]28th August 2012
            [*]by Amal Ahmed
                
       		[/LIST]

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

	 [URL=#] ...More[/URL]

[/HTML]
```


----------



## JiminSA (Dec 15, 2011)

Take a look at the css styling for div id = post1 and you may have solved your problem...


----------



## mwdesign (Aug 20, 2010)

```
#post1 {overflow: hidden;
	line-height: 20px;
	margin-top:0px; 
	height:100px;
	width:320px; 
	float:left; 
	font-family:Arial, Helvetica, sans-serif;
	color:#666; 
	font-size:14px;
	border-top:thin dotted #666; 
	padding-top:15px; 
	margin:5px 20px 10px 20px;}
```
all the post ids have a fixed height....but the titles may go onto multiple lines (hence the container changing height.

What would i change to fix it?

Thanks


----------



## JiminSA (Dec 15, 2011)

I would take out the restricting height:100px; statement... and let it run


----------



## mwdesign (Aug 20, 2010)

No unfortunately that didnt work. 

Is it likely that its something to do with the floats? or position state of the divs?


----------



## JiminSA (Dec 15, 2011)

Oops!
I didn't ask you to take out "overflow: hidden;" - which is the reason for truncation when associated with a restricting height clause...


----------



## JiminSA (Dec 15, 2011)

Did you try it without overflow: hidden; ??


----------

