How to create: warning buttons
- Previous Page Website Icon
- Next Page Outline Button
Learn how to use CSS to set the style of 'warning' buttons.
How to design the style of warning buttons
Step 1 - Add HTML:
<button class="btn success">Success</button> <button class="btn info">Info</button> <button class="btn warning">Warning</button> <button class="btn danger">Danger</button> <button class="btn default">Default</button>
Step 2 - Add CSS:
.btn { border: none; /* Remove border */ color: white; /* Add text color */ padding: 14px 28px; /* Add some inner padding */ cursor: pointer; /* Add pointer cursor on hover */ } .success {background-color: #04AA6D;} /* 绿色 */ .success:hover {background-color: #46a049;} .info {background-color: #2196F3;} /* 蓝色 */ .info:hover {background: #0b7dda;} .warning {background-color: #ff9800;} /* 橙色 */ .warning:hover {background: #e68a00;} .danger {background-color: #f44336;} /* 红色 */ .danger:hover {background: #da190b;} .default {background-color: #e7e7e7; color: black;} /* 灰色 */ .default:hover {background: #ddd;}
Related Pages
Tutorial:CSS Button
- Previous Page Website Icon
- Next Page Outline Button