elibraryportal Logo

CSS Buttons Example

Learn how to style buttons in CSS

Example:-

Test it Now

Button Colors

Use the background-color property to change the background color of a button or links:

Example:-

Test it Now

Button Sizes

Use the font-size property to change the font size of a button:

Example:-

Test it Now

Rounded Buttons

Use the border-radius property to add rounded corners to a button:

Example:-

Test it Now

Border Button Colored

To Use the border property for add a colored on border to button:

Example:-

Test it Now

Hoverable Buttons


To use the hover selector to change the style of a button when you move the mouse over it.

Example:-

Test it Now

Disabled Buttons

To Use the opacity property to add transparency to a button (creates a "disabled" look).

Example:-

Test it Now

Button Groups


Remove margins and add float:left to each button to create a button group:

Example:-

Test it Now

Bordered Button Group


To use the border property to create a bordered button group:

Example:-

Test it Now

Vertical Button Group


Use display:block instead of float:left to group the buttons below each other, instead of side by side:

Example:-

Test it Now

Animated Buttons

Add an arrow on hover:


Test it Now