I am currently trying to pick up css. It's going okay so far, however I am having an issue I haven't had a problem with until now.
I have a <div>
containing two further <div>
's.
I expect the "parent" <div>
to act as a parent (automatic height, etc.) and actually "contain" the two child <div>
's.
My code:
<div class="formpair">
<div class="formlabel formitem">
Parent Section:
</div>
<div class="formcontrol formitem">
<select>
</select>
</div>
</div>
My CSS:
.formitem {
position: relative;
float: left;
}
.formlabel {
width: 200px;
}
.formcontrol {
position: absolute;
left: 200px;
}
.formpair {
clear: both;
margin-bottom: 4px;
height: auto;
position: relative;
display: block;
}
I have tried experimenting with "position" and "display" but to no avail... any help appreciated!