Learn how to style download buttons with CSS. Elevate your website's aesthetics by learning how to skillfully style download buttons using CSS for a polished and user-friendly design.
Step 1) Add HTML:
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>
Step 2) Add CSS:
/* 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;
}
#css