Posted in svg
5656
10:28 pm, December 3, 2020
 

download icon svg

a simple download icon in svg format, also added button example usage so you can use the svg within the button as an icon and change the fill colour on mouse over, plus it scales nicely on mobile devices or higher res screens.

HTML

<svg class="fill-current w-4 h-4 mr-2 download-icon-64" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z"/></svg>

<svg class="fill-current w-4 h-4 mr-2 download-icon-128" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z"/></svg>
<hr>
<h3>Example usage in a download button</h3>
<p>You can see how the fill of the svg can be changed when the button becomes active.</p>
<p><a href='#!' class='button-download'><svg class="fill-current w-4 h-4 mr-2 download-icon-32" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z"/></svg> Download Button</a></p>

CSS

.download-icon-64 {
 width:64px;
}
.download-icon-128 {
 width:128px;
}
.download-icon-32 {
 width:32px;
}
.button-download:hover svg {
    fill: #FFF;
}
.button-download:hover {
    color: #FFF;
    background:#666;
    text-decoration: none;
    box-shadow:0px 1px 5px rgba(0,0,0,0.5);
    border: 2px solid #EEE;
}
.button-download {
    padding: 10px 20px;
    text-align: center;
    color: #666;
    display: inline-block;
    border-radius: 3px;
    border: 2px solid #999;
    text-decoration: none;
    font-weight: bold;
}
.button-download svg {
    fill: #999;
    width: 26px;
}

Example usage in a download button

You can see how the fill of the svg can be changed when the button becomes active.

Download Button

View Statistics
This Week
249
This Month
734
This Year
1650

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
You want to be the best, you MUST put the long yards in! Nothing comes easy in life so stop wishing and start DOING! So many people would rather bitch and moan than help themselves. Dont be one of those negative drainers, start today, make a small change and keep going forwards with this attitude!
Unknown
Random CSS Property

border-inline-width

The border-inline-width CSS property defines the width of the logical inline borders of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-width and border-bottom-width, or border-left-width, and border-right-width property depending on the values defined for writing-mode, direction, and text-orientation.
border-inline-width css reference