Learn how to create loading buttons with CSS.
Add an icon library, such as Font Awesome, and append icons to HTML buttons:
<!-- 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 buttons */
.buttonload {
background-color: #04AA6D; /* Green background */
border: none; /* Remove borders */
color: white; /* White text */
padding: 12px 16px; /* Some padding */
font-size: 16px /* Set a font size */
}
Try it Yourself »
Tip: Go to our Icons Tutorial to learn more about icons.
Tip: Go to our How To - CSS Loader to learn how to create a loader with CSS (without an icon library).
Go to our CSS Buttons Tutorial to learn more about how to style buttons.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!