I'm facing a challenge with two columns in a container, both having dynamic heights and different color backgrounds. I want the columns to always be the size of the taller one regardless of the content. How can I achieve this using CSS?
Here is the HTML structure:
<div id="profile-bottom">
<div id="bottom-left">
</div>
<div id="bottom-right">
</div>
</div>
I attempted to use display: table and table-cell properties, but I couldn't get it to work as expected.
Below is the CSS code:
#profile-bottom {
display: table;
position: relative;
width: 450px;
height: auto;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
border-radius: 0px 0px 4px 4px;
overflow: hidden;
z-index: 10;
}
#bottom-left {
display: table-cell;
position: relative;
float: left;
margin: 0px 0px 0px 0px;
padding: 95px 20px 20px 20px;
height: auto;
width: 150px;
box-shadow: rgba(0, 0, 0, 0.147059) 0px 1px 8px 0px;
background-color: #fff;
z-index: 50;
}
#bottom-right {
display: table-cell;
position: relative;
float: left;
margin: 0px 0px 0px 0px;
padding: 0px 20px 20px 20px;
height: auto;
min-height: 96px;
width: 220px;
background-color: #f5f5f5;
z-index: 10;
}