ersi
ersi

Reputation: 256

Having problem with borders on segmented button using tailwind

Trying to create segmented button, but having problem with borders. I want to have 1px border everywhere including between buttons

Structure for 2nd variant (buttons are rendered dynamically)

<div class="divide-x">
 <button class="border-y first:border-l last:border-r">
</div>

I have tried multiple ways of borders

any suggestions?

enter image description here

Upvotes: 0

Views: 640

Answers (1)

Layhout
Layhout

Reputation: 1590

like this?

<div class="divide-x divide-black border border-black rounded-full">
    <button class="py-2 px-8">hello</button>
    <button class="py-2 px-8">hello</button>
    <button class="py-2 px-8">hello</button>
    <button class="py-2 px-8">hello</button>
</div>

or like this?

<div class="flex">
    <button class="py-2 px-8 border-y border-l first:rounded-l-full last:border-r last:rounded-r-full border-black">hello</button>
    <button class="py-2 px-8 border-y border-l first:rounded-l-full last:border-r last:rounded-r-full border-black">hello</button>
    <button class="py-2 px-8 border-y border-l first:rounded-l-full last:border-r last:rounded-r-full border-black">hello</button>
    <button class="py-2 px-8 border-y border-l first:rounded-l-full last:border-r last:rounded-r-full border-black">hello</button>
</div>

Upvotes: 1

Related Questions