I'm using daisyUI's radio tab lifted + tab content. The code is the same with the demo, except the I only use 2 tabs and fill content to them:
<div role="tablist" class="tabs tabs-lifted">
<input type="radio" name="my_tabs_2" role="tab" class="tab" aria-label="Tab 1 is very long" />
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 rounded-box p-6"></div>
<input type="radio" name="my_tabs_2" role="tab" class="tab" aria-label="Tab 2 is very very long" checked />
<div role="tabpanel" class="tab-content bg-base-100 border-base-300 rounded-box p-6">
1111 2222 3333 4444 5555 6666 77
</div>
</div>
At 32 characters, the tab label widths behave as expected: they fill all the horizontal space:
Starting from 32, they squish a little bit:
Each addition character squishes the width more. It reaches its minimum at 53 characters:
If we start again, but this time we use no space, then the maximum length is 7 before it start squishing:
The width reaches its minimum when the character length uses up the available horizontal space:
The squish only takes effect on its respective tab. The other one is intact.
Why does this happen? How do I prevent this?





You can prevent that by setting
grid-columnof the tab panel to the amount of tabs you have:As for why it happens, the
.tab-contenthas:At the small width of 274px, the content of the
.tab-contentbecomes significant and affects the width of these other 9997 grid column tracks that the.tab-contentspans, shrinking the grid column tracks that the tab labels reside.