codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › CSS buttons

CSS buttons

Make button designs.

Remove default borders, add padding, radius, colors and hover and focus states.

Example code

<style>
.b{background:#1b998b;color:#fff;border:0;padding:10px 22px;border-radius:24px;cursor:pointer;transition:background .2s}
.b:hover{background:#127a6f}.b:focus-visible{outline:3px solid gold}
.o{background:none;border:2px solid #1b998b;color:#1b998b}
</style>
<button class='b'>Primary</button> <button class='b o'>Outline</button>

Run this code in the online editor

← object-fit and positionMultiple columns →