I'm trying to make a card that's:
- Split into two unequal columns of the same height (80%/20%)
- In the right column, split into two (or more) rows
So something like:
What's happening is that I'm getting lots of whitespace around the two right boxes. I had tried adjusting the <p>
tags' margins to 0, but then the entire column height becomes unequal with the left larger column. Anyone know how to accomplish this?
.cardWrap {
box-sizing: border-box;
max-width: 1024px;
border: 2px solid #e5bc73;
}
.cardContent {
display: flex;
width: 100%;
box-sizing: border-box;
}
.left {
flex: 0 1 80%;
flex-direction: column;
padding: 15px;
}
.right {
flex: 0 1 20%;
flex-direction: row;
}
.gold {
background-color: #e5bc73;
}
.black {
background-color: #000;
color: #fff;
}
<div class="cardWrap">
<div class="cardContent">
<div class="left">
<h4>Header</h4>
<p>Some text</p>
</div>
<div class="right">
<div class="gold">
<p>Baaaah</p>
<p>Baaaah</p>
<p>Baaaah</p>
<p>Baaaah</p>
<p>Baaaah</p>
</div>
<div class="black">
<p>Moo</p>
</div>
</div>
</div>
</div>