I would like to set height in a flex item only when it gets into the next line, how can I achieve this?
<div class="flex-container">
<div class="flex-element">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
<div class="flex-element"> <!-- This is the element we want to conditionally style -->
Second element
</div>
</div>
CSS:
.flex-container {
display: inline-flex;
flex-flow: row wrap;
justify-content: center;
align-items: center;
}
.flex-element {
background-color: #cecece;
margin: 1rem;
text-align: center;
padding: 0.5rem 1rem 0.5rem 1rem;
}
So in this dummy example I want to apply some specific style to the second flex-element but ONLY when it gets into the next line.
Is it possible?