suchen

Heim  >  Fragen und Antworten  >  Hauptteil

Tailwind CSS: Erstellen Sie einen pillenförmigen Button

Ich habe diesen Button:

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

Ich würde gerne so etwas sehen: https://tailwindcss.com/docs/border-radius#pill-buttons

Allerdings bekomme ich den pillenförmigen Knopf nicht hin:

index.css

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

tailwind.config.js

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

P粉189606269P粉189606269319 Tage vor472

Antworte allen(1)Ich werde antworten

  • P粉986860950

    P粉9868609502024-03-27 19:47:44

    为了看到“药丸”形状,您的按钮需要边框或背景颜色。你可以尝试这样的事情:

    
    

    沙盒示例:https://play.tai​​lwindcss.com/j6K2e6ZL0J

    Antwort
    0
  • StornierenAntwort