#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · LIVE PREVIEW

CSS Button Generator: Design a Button and Copy Clean CSS

Style a button with sliders and colour pickers, try it live, and copy ready CSS.

  • 🎨 Colours and sizes
  • 🖱️ Hover and active states
  • ♿ Focus ring included

How to use the CSS Button Generator

  1. 1. Pick the styleSet the text, colours, padding, corner radius, font and border.
  2. 2. Try itHover over and click the preview to see the hover and active states.
  3. 3. Copy the codePress Get CSS & HTML and paste it into your project.

What the generated CSS includes

A good button is more than a coloured box. The code you get includes:

  • Base style: padding, font size and weight, colours, border and corner radius.
  • :hover: the background darkens by the percentage you choose, so users can see it is clickable.
  • :active: the button moves down by 1px when pressed, which feels responsive.
  • :focus-visible: a clear outline for keyboard users, which many generators leave out.
  • An optional soft shadow in the button's own colour, and a short transition so changes feel smooth.

Worked example and tips

The defaults make an orange (#ff5421) button with 12px × 24px padding, a 10px radius and 600-weight text. With hover darken at 12%, each colour channel is multiplied by 0.88, so the hover colour is #e04a1d. The shadow uses the same orange at 35% opacity.

  • Keep text contrast high. White on a mid-tone colour usually passes; light yellow on white does not.
  • Make tap targets at least 44px tall on phones: 12px top and bottom padding with 16px text gets you there.
  • Use a real <button> for actions and <a> for links to pages. Both can use the same class.
Once you are happy with one button, reuse the same class across your site so every call to action looks and behaves the same, which builds trust.

Frequently asked questions

More free tools

See all free tools