Tailwind CSS: Make a pill-shaped button
P粉189606269
P粉189606269 2024-03-26 20:59:03
0
1
420

I have this button:

<button onClick={() => removeTask(task)} class="text-xs text-red rounded-full">Delete</button>

I'd like to see something like this: https://tailwindcss.com/docs/border-radius#pill-buttons

However, I don't get the pill-shaped button:

index.css

    @tailwind base;
    @tailwind components;
    @tailwind utilities;

tailwind.config.js

    module.exports = {
      content: ["./src/**/*.{html,js,jsx}"],
      theme: {
        extend: {},
      },
      plugins: [],
    };

P粉189606269
P粉189606269

reply all(1)
P粉986860950

In order to see the "pill" shape, your button needs a border or background color. You could try something like this:


Sandbox example:https://play.tailwindcss.com/j6K2e6ZL0J

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template