How can I get my div to shrink to my text size using tailwind

Viewed 21
<div class="grid grid-cols-1 mt-5 mx-7">
    <label class="border uppercase md:text-sm text-xs text-gray-500 text-light font-semibold text-left" data-tooltip-target="tooltip-default">Registration Type</label>
</div>

The div is currently the width of the screen but I'd like it to only be the width of the text.

enter image description here

1 Answers

You need to add class for width.

<div class="grid grid-cols-1 mt-5 mx-7 w-fit">
    <label class="border uppercase md:text-sm text-xs text-gray-500 text-light font-semibold text-left" data-tooltip-target="tooltip-default">Registration Type</label>
</div>
Related