I have two child divs next to each other inside a parent div. I don't know what the height of either div has to be, because its generated by viewport-height.
My problem is that in the left div I have an image and I don't know how I can get that image the same size as the right div which needs to have height: auto. The parent div has to be adjust to the second child div.
HTML
<div class="post-info">
<a href="" class="post-link">
<div class="post-info_img"></div>
<div class="post-info_content">
<p class="categorie_info">Category</p>
<p class="titel">Header</p>
<p class="info">
Lorem ipsum dolor sit amet...
</p>
<p class="date">June 2018</p>
</div>
</a>
</div>
CSS
.post-info {
width: 90vw;
border-radius: 15px;
background-color: #F6F6F6;
box-shadow: 0px 3px 0px 0px rgba(0,0,0,0.2);
margin-bottom: 2.5vh;
display: table;
}
.post-info_img {
background-image: url('http://via.placeholder.com/350x150');
width: 30vw;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
border-radius: 15px 0 0 15px;
display: table-cell;
}
.post-info_info {
padding: 5% 4vw;
display: table-cell;
}
.categorie_info {
color: #5B7AEB;
}
.titel {
font-size: 14px;
color: #2B2B2B;
margin: 0;
}
.info {
font-size: 14px;
margin-top: 5px;
}
.date {
font-size: 12px;
color: #707070;
}
.post-info {
width: 90vw;
border-radius: 15px;
background-color: #F6F6F6;
box-shadow: 0px 3px 0px 0px rgba(0, 0, 0, 0.2);
margin-bottom: 2.5vh;
display: table;
}
.post-info_img {
background-image: url('http://via.placeholder.com/350x150');
width: 30vw;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
border-radius: 15px 0 0 15px;
display: table-cell;
}
.post-info_info {
padding: 5% 4vw;
display: table-cell;
}
.categorie_info {
color: #5B7AEB;
}
.titel {
font-size: 14px;
color: #2B2B2B;
margin: 0;
}
.info {
font-size: 14px;
margin-top: 5px;
}
.date {
font-size: 12px;
color: #707070;
}
<div class="post-info">
<a href="" class="post-link">
<div class="post-info_img"></div>
<div class="post-info_content">
<p class="categorie_info">Category</p>
<p class="titel">Header</p>
<p class="info">
Lorem ipsum dolor sit amet...
</p>
<p class="date">June 2018</p>
</div>
</a>
</div>