So, I'm in a situation where I have to use 'floated' divs. Two child divs next to each other inside a parent div. The right div is fixed width and taller, and I want the left div to expand to be the same height as the right one.
Here's the sample. I want the left div to be the same height as the right div. And I have to use floats. No changing to absolute positioning or display:table or anything.
Anyone know if this is possible?
html, body {
height: 100%;
}
div {
font-family: Tahoma, Verdana sans-serif;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.container {
width: 100%;
background-color: rgba(255, 255, 0, 1);
overflow: auto;
}
.left {
height: 100%;
width: calc(100% - 100px);
background-color: rgba(0, 0, 255, 0.6);
float: left;
padding: 20px;
border: dashed thick blue;
}
.right {
float: right;
width: 100px;
padding: 20px;
border: dashed thick green;
}
<div class="container">
<div class="left">
LEFT
</div>
<div class="right">
RIGHT RIGHT RIGHT RIGHT
</div>
</div>
fiddle here too: https://jsfiddle.net/y0zatg8w/