Learn how to style buttons using CSS.
Fueling this need for instantaneity is redbutton.tv with mesmerizing experiences, real time storytelling, and patented, award winning audience engagement, which is all captured and measured to give proof of the impact and success you've achieved! You see, we operate and WoW NOW, while it's relevant, when it counts, when it means something. Customizable splash page and login options can include email, cellphone, facebook, etc, or just click a button! 3 After login, RedButton can redirect users to a url of your choice, like your homepage, or Tripadvisor. From Wikipedia, the free encyclopedia Red Buttons (born Aaron Chwatt; February 5, 1919 – July 13, 2006) was an American actor and comedian. He won an Oscar and a Golden Globe for his supporting role in the 1957 film Sayonara. The 'red button' name refers to the common interface on remote controls for digital televisions and set-top boxes, a red push-button which launches digital teletext services. Although initially marketed as a spectacular new form of television, by 2008 this had given way to positioning iTV as ‘everyday'. Mini Bio (1) Although Red Buttons is best known as a stand-up comic, he is also a successful songwriter, an Academy Award-winning actor (and has been nominated for two Golden Globe awards) and an accomplished singer.
Basic Button Styling
Example
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
Button Colors
Use the background-color
property to change the background color of a button:
Example
.button2 {background-color: #008CBA;} /* Blue */
.button3 {background-color: #f44336;} /* Red */
.button4 {background-color: #e7e7e7; color: black;} /* Gray */
.button5 {background-color: #555555;} /* Black */
Red Buttons
Button Sizes
Use the font-size
property to change the font size of a button:
Example
.button2 {font-size: 12px;}
.button3 {font-size: 16px;}
.button4 {font-size: 20px;}
.button5 {font-size: 24px;}
Use the padding
property to change the padding of a button:
Example
.button2 {padding: 12px 28px;}
.button3 {padding: 14px 40px;}
.button4 {padding: 32px 16px;}
.button5 {padding: 16px;}
Rounded Buttons
Use the border-radius
property to add rounded corners to a button:
Example
.button2 {border-radius: 4px;}
.button3 {border-radius: 8px;}
.button4 {border-radius: 12px;}
.button5 {border-radius: 50%;}
Colored Button Borders
Use the border
property to add a colored border to a button:
Example
background-color: white;
color: black;
border: 2px solid #4CAF50; /* Green */
}
...
Red Button Ice Cream
Try it Yourself »Hoverable Buttons
Use the :hover
selector to change the style of a button when you move the mouse over it.
Tip: Use the transition-duration
property to determine the speed of the 'hover' effect:
Example
transition-duration: 0.4s;
}
.button:hover {
background-color: #4CAF50; /* Green */
color: white;
}
...
Shadow Buttons
Use the box-shadow
property to add shadows to a button:
Example
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.button2:hover {
box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
}
Disabled Buttons
Use the opacity
property to add transparency to a button (creates a 'disabled' look).
Tip: You can also add the cursor
property with a value of 'not-allowed', which will display a 'no parking sign' when you mouse over the button:
Example
Try it Yourself »Button Width
By default, the size of the button is determined by its text content (as wide as its content). Use the width
property to change the width of a button:
Example
.button2 {width: 50%;}
.button3 {width: 100%;}
Button Groups
Remove margins and add float:left
to each button to create a button group:
Example
Try it Yourself »Bordered Button Group
Use the border
property to create a bordered button group:
Example
Try it Yourself »Vertical Button Group
Use display:block
instead of float:left
to group the buttons below each other, instead of side by side:
Example
Try it Yourself »Button on Image
Try it Yourself »Animated Buttons
Example
Add an arrow on hover:
Try it Yourself »Example
Add a 'pressed' effect on click:
Try it Yourself »Example
Fade in on hover:
Try it Yourself »Red Button Ice Cream
Example
Add a 'ripple' effect on click:
Button Colors
Use the background-color
property to change the background color of a button:
Example
.button2 {background-color: #008CBA;} /* Blue */
.button3 {background-color: #f44336;} /* Red */
.button4 {background-color: #e7e7e7; color: black;} /* Gray */
.button5 {background-color: #555555;} /* Black */
Red Buttons
Button Sizes
Use the font-size
property to change the font size of a button:
Example
.button2 {font-size: 12px;}
.button3 {font-size: 16px;}
.button4 {font-size: 20px;}
.button5 {font-size: 24px;}
Use the padding
property to change the padding of a button:
Example
.button2 {padding: 12px 28px;}
.button3 {padding: 14px 40px;}
.button4 {padding: 32px 16px;}
.button5 {padding: 16px;}
Rounded Buttons
Use the border-radius
property to add rounded corners to a button:
Example
.button2 {border-radius: 4px;}
.button3 {border-radius: 8px;}
.button4 {border-radius: 12px;}
.button5 {border-radius: 50%;}
Colored Button Borders
Use the border
property to add a colored border to a button:
Example
background-color: white;
color: black;
border: 2px solid #4CAF50; /* Green */
}
...
Red Button Ice Cream
Try it Yourself »Hoverable Buttons
Use the :hover
selector to change the style of a button when you move the mouse over it.
Tip: Use the transition-duration
property to determine the speed of the 'hover' effect:
Example
transition-duration: 0.4s;
}
.button:hover {
background-color: #4CAF50; /* Green */
color: white;
}
...
Shadow Buttons
Use the box-shadow
property to add shadows to a button:
Example
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.button2:hover {
box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
}
Disabled Buttons
Use the opacity
property to add transparency to a button (creates a 'disabled' look).
Tip: You can also add the cursor
property with a value of 'not-allowed', which will display a 'no parking sign' when you mouse over the button:
Example
Try it Yourself »Button Width
By default, the size of the button is determined by its text content (as wide as its content). Use the width
property to change the width of a button:
Example
.button2 {width: 50%;}
.button3 {width: 100%;}
Button Groups
Remove margins and add float:left
to each button to create a button group:
Example
Try it Yourself »Bordered Button Group
Use the border
property to create a bordered button group:
Example
Try it Yourself »Vertical Button Group
Use display:block
instead of float:left
to group the buttons below each other, instead of side by side:
Example
Try it Yourself »Button on Image
Try it Yourself »Animated Buttons
Example
Add an arrow on hover:
Try it Yourself »Example
Add a 'pressed' effect on click:
Try it Yourself »Example
Fade in on hover:
Try it Yourself »Red Button Ice Cream
Example
Add a 'ripple' effect on click:
Try it Yourself »