[html]
<!-- Add icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Add font awesome icons to buttons (note that the fa-spin class rotates the icon) -->
<button class="buttonload">
<i class="fa fa-spinner fa-spin"></i>Loading
</button>
<button class="buttonload">
<i class="fa fa-circle-o-notch fa-spin"></i>Loading
</button>
<button class="buttonload">
<i class="fa fa-refresh fa-spin"></i>Loading
</button>
<style>
/* Style buttons */
.buttonload {
background-color: #4CAF50; /* Green background */
border: none; /* Remove borders */
color: white; /* White text */
padding: 12px 16px; /* Some padding */
font-size: 16px /* Set a font size */
}
</style>
[/html]
Шаг 1) добавить HTML:
Добавьте в HTML-кнопки библиотеку значков, такую как Font Awesome, и добавляйте значки.
<!-- Add icon library --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- Add font awesome icons to buttons (note that the fa-spin class rotates the icon) --> <button class="buttonload"> <i class="fa fa-spinner fa-spin"></i>Loading </button> <button class="buttonload"> <i class="fa fa-circle-o-notch fa-spin"></i>Loading </button> <button class="buttonload"> <i class="fa fa-refresh fa-spin"></i>Loading </button>
Шаг 2) добавить CSS:
/* Style buttons */ .buttonload { background-color: #4CAF50; /* Green background */ border: none; /* Remove borders */ color: white; /* White text */ padding: 12px 16px; /* Some padding */ font-size: 16px /* Set a font size */ }
- Подпись автора