How to create: warning button
- Pagina precedente Icona del sito
- Pagina successiva Pulsante contorno
Learn how to use CSS to set the style of the 'warning' button.
How to design the style of the warning button
First step - 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>
Second step - Add CSS:
.btn { border: none; /* 删除边框 */ color: white; /* 添加文本颜色 */ padding: 14px 28px; /* 添加一些内边距 */ cursor: pointer; /* 添加鼠标悬停时的指针光标 */ } .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;}
Pagine correlate
Tutorial:Pulsante CSS
- Pagina precedente Icona del sito
- Pagina successiva Pulsante contorno