Previous Message
Next Message

Div with height that changes with content?

Sent by Neil Lee on 3 February 2005 20:08


Hi folks -

I'm having a heck of a time getting a particular bit of code to work, 
and could really use a fresh pair of eyes (and brains) to give me some 
help.

I have a set of divs, each which contains a smaller div floated left 
and an unordered list that I am floating right. A screenshot of what I 
have working is here:

<http://homepage.mac.com/thenonsuch/stuff/css_list.png>

My dilemma is that I am currently setting the height of the containing 
div as well as the smaller div (the one with the month in it). If the 
unordered list is longer than five lines the extra lines disappear 
under the next containing div.

Any anyone help me figure out how to get both of the div's heights to 
stretch based on how much content is in the unordered list? Any help is 
really appreciated...

Here is the HTML and CSS I am using:

<div class="tipsCategory">
	<div class="categoryMeta">
	<h2>Month and Year</h2>
	</div>

<ul>
	<li></li>
</ul>

</div>

==================================
..tipsCategory {
	border-top: 1px dotted #aaa;
	border-left: 1px solid #ccc;
	padding: 0px 10px 0px 0px;
	clear: left;
	height: 85px;
}

..tipsCategory .categoryMeta {
	width: 115px;
	height:  85px;
	padding: 3px 3px 0 10px;
	background-color: #f1f1f1;
	border-right: 1px solid #ccc;
	float: left;
}

#events h2 {
	font: 140%/1.2em helvetica, "trebuchet ms", sans-serif;
	color: #333;
}

#events .tipsCategory ul {
	width: 340px;
	float: right;
	list-style: none;
	margin: 0 0;
	padding: 3px 0 0 0;
}

#events .tipsCategory li {
	margin-bottom: 3px;
}
-- 
Slumming at the beatnikPad : http://www.beatnikpad.com/
The person you love is 72.8% water.

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: