Despite my research and understanding of floats, I am struggling to comprehend why I am unable to evenly float two divs within a wrapping div.
#wrap {
border: 1px solid red;
height: 200px;
width: 100%;
}
#gr1 {
border: 1px solid blue;
float: left;
}
#gr2 {
border: 1px solid blue;
float: left;
}
<div id="wrap">
<div id="gr1">Group 1
</div>
<div id="gr2">Group 2
</div>
</div>
My expectation is that Group 1 and Group 2 will always equally fill the width of the wrapping div as shown in the image below. I want this layout to remain consistent regardless of the browser size. Despite attempting to set gr1 and gr2 widths to 50%, gr2 consistently drops down below gr1. What aspect am I overlooking?