I am struggling with setting a dive container that has a class of d with a red background color, and an inner div with class d2 that has a gray background color.
These specifications are illustrated in the pictures below,
and I would like div d to take on the height of div d2, but I am unsure how to achieve this.
This is the code snippet:
.d
{
width:100%;
height:100px;
background-color:red;
}
.d2
{
width:80%;
height:auto;
float:left;
background-color:Gray;
}
If I set the height of div d to "auto," the red color will disappear.