Learn how to style download buttons with CSS.
Auto width:
Full width:
Try it Yourself »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">
<!-- Auto width -->
<button class="btn"><i class="fa fa-download"></i> Download</button>
<!-- Full width -->
<button class="btn" style="width:100%"><i class="fa fa-download"></i> Download</button>
/* Style buttons */
.btn {
background-color: DodgerBlue;
border: none;
color: white;
padding: 12px 30px;
cursor: pointer;
font-size: 20px;
}
/* Darker background on mouse-over */
.btn:hover {
background-color: RoyalBlue;
}
Try it Yourself »
Tip: Go to our Icons Tutorial to learn more about icons.
Go to our CSS Buttons Tutorial to learn more about how to style buttons.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!