Bharat D Bhadresha
Bharat D Bhadresha

Reputation: 779

How to prevent flexboxes from shrinking?

I have two flexboxes which shrink on height change and nested content gets overlapped. How to prevent this?

Upvotes: 5

Views: 1694

Answers (1)

iamkunjal
iamkunjal

Reputation: 58

just add flex-shrink:0 to your element and the flexbox will stop shrinking.

<div class="flx">
    Some Content
</div>

<div class="flx">
    Some Content
</div>

<style>
    .flx{
        display: flex;
        flex-shrink: 0;
    }
</style>

Upvotes: 3

Related Questions