Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

2 columns, one fixed, using Tailwind flexbox

I simply want to put two divs side by side. The one on the left should be 40px width. If the text does not overflow, there is no problem. But when it comes to overflow, it crushes the width on the left and compresses it as much as it can. What is the solution?

Code (from JSX):

<div className="flex">
     <div className="flex w-10 h-10 items-center justify-center">
          a
     </div>
     <div className="flex bg-red">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda atque, cumque illo ipsam itaque iure iusto nam officia reiciendis vero.
     </div>
</div>

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Instead of setting w-10 on left div, you can use min-w-[40px].

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading