troubleshooting Question

Parent div height

Avatar of Albert Van Halen
Albert Van HalenFlag for Netherlands asked on
Web Languages and StandardsCSSHTML
2 Comments1 Solution1070 ViewsLast Modified:
I have a layout where several controls are in.
My problem is that the controls, which are divs, are child elements of other divs.

Now, the parent div in which the controls are, don't get as high as the controls are; so the controls are over one another.
I can't specify the height since each control varies in height and I don't know how high a control will get on beforehand.

See the attached code.

I think I have to do something with the element which has the class toolboxItemContent but what...

Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<title>Layout test</title>
	<style type="text/css">
		INPUT[type=text], SELECT
		{
			width: 100%;
			border: 1px solid silver;
		}
		.toolboxItemGroup
		{
			border: 1px dotted black;
			display: block;
			padding: 5px;
			margin: 5px;
			min-height: 100px;
		}
		.headerText
		{
			border-bottom: solid 1px black;
			padding-bottom: 5px;
			margin-bottom: 5px;
			font-weight: bold;
			color: black;
			font-size: 11px;
			clear: both;
			text-align: left;
		}
		.toolboxItem
		{
			margin: 5px 0px;
			border: 1px outset silver;
		}
		.toolboxItemHeader
		{
			background-color: #CCC;
			padding: 0px 5px;
			display: block;
			height: 20px;
			position: relative;
		}
		.toolboxItemDesignerOptions
		{
			position: absolute;
			right: 2px;
			top: 2px;
		}
		.toolboxItem .toolboxItemContent
		{
			padding: 5px;
		}
	</style>
</head>
<body>
	<div class="toolboxItemGroup">
		<div class="headerText">
			My fields</div>
		<div class="toolboxItem">
			<div class="toolboxItemHeader">
				<span>First date</span> <span class="toolboxItemDesignerOptions">
					<img src="/Shared/Images/Options16.gif" class="options" title="Properties" />
					<img src="/Shared/Images/Close16.gif" class="remove" title="Remove field" />
				</span>
			</div>
			<div class="toolboxItemContent">
				<div id="ctl00_cphDetail_ctl01_dtpDate">
					<div style="padding-bottom: 2px; position: relative; width: 100%">
						<div style="width: 30%; left: 0px; position: absolute;">
							<label>
								Date</label>
						</div>
						<div style="right: 0px; position: absolute; left: 30%;">
							<div style="width: 100%; position: relative;">
								<div style="right: 25px; position: absolute; left: 0px;">
									<input type="text" id="ctl00_cphDetail_ctl01_dtp_Date_txtDate_dtpDate" name="ctl00$cphDetail$ctl01$dtp_Date$txtDate_dtpDate" />
								</div>
								<div style="right: 0px; position: absolute; text-align: right;">
									<input type="image" style="border-width: 0px;" src="/Shared/Images/Calendar16.gif" />
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="toolboxItem">
			<div class="toolboxItemHeader">
				<span>Rubricering</span> <span class="toolboxItemDesignerOptions">
					<img src="/Shared/Images/Options16.gif" class="options" title="Properties" />
					<img src="/Shared/Images/Close16.gif" class="remove" title="Remove field" />
				</span>
			</div>
			<div class="toolboxItemContent">
				<div>
					<div style="width: 30%; display: inline; float: left;">
						<label>
							Category</label>
					</div>
					<div style="width: 70%; display: inline; float: left;">
						<input type="radio" name="Category" value="1" />Category 1<br />
						<input type="radio" name="Category" value="2" />Category 2<br />
						<input type="radio" name="Category" value="3" />Category 3<br />
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
ASKER CERTIFIED SOLUTION
Albert Van Halen
Analyst developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros