adc

clicks

How To Create Download Button Using HTML And CSS

 

 

HTML

Before we start writing code first, we need to create a primary structure of the HTML document, so that the browser can understand and start working. The basic HTML structure looks like the following.

After writing the primary structure of the HTML document, you will also write the tags and content you need. After that, you can see the output in your browser. We know that HTML Sudu Mae is used for exposing content in a basic format. To complete our content we need to use CSS, which is an HTML insert and it creates an engaging user interface.

<!DOCTYPE html>

<html>
<head>
            <title>Dwonload Button</title>
            <link rel="stylesheet" type="text/css" href="style.css">
            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
                        <div class="cntainer">
                                    <form>
                                                <button><i class="fa fa-download"></i></button>
                                                <button><i class="fa fa-download"></i></button>
 
                                                <br>
 
                                                <button><i class="fa fa-download"></i></button>
                                                <button><i class="fa fa-download"></i></button>
                                    </form>
                        </div>
</body>
</html>

CSS

 Now, we have time to improve the HTML content, for that, we need to add CSS to the HTML file. CSS can be added to HTML documents in a total of three ways, here we are using outside CSS design using CSS will arrive here after typing and see the output in your browser.

*{
            margin: 0;
            padding: 0;
}
.container{
            margin: auto;
            display: flex;
            height: 100vh;
 
}
form{
            margin: auto;
}
button {
            width: 250px;
            height: 50px;
            text-align: left;
            position: relative;
            border:none;
            outline: none;
            border-radius: 10px;
            box-shadow: 0 3px 3px #aaa;
            margin: 40px;
            font-size: 20px;
            font-weight: bold;
            color: #333;
            padding-left: 20px;
            box-sizing: border-box;
 
}
 
button::after {
            content: "";
            position: absolute;
            background-color: salmon;
            width: 30px;
            margin-right: 155px;
            bottom: 0;
            top: 0;
            right: 0;
            transform: skew(-30deg);
} 
button::before{
            content:"download";
            line-height: 50px;
            text-align: center;
            border-radius: 0 10px 10px 0;
            position: absolute;
            background-color: salmon;
            width: 170px;
            bottom: 0;
            top: 0;
            right: 0;
}
button:nth-child(2)::after,form button:nth-child(2)::before{
            background-color: skyblue;
}
button:nth-child(4)::after,form button:nth-child(4)::before{
            background-color: #47b39d;
}
button:nth-child(5)::after,form button:nth-child(5)::before{
            background-color: #ffc153;
}
button:hover{
            filter: brightness(.8);
}

 

Free Source Code

Watch Vidoes




 


How To Create Download Button Using HTML And CSS How To Create Download Button  Using HTML And CSS Reviewed by easycoding on September 17, 2020 Rating: 5

1 comment:

  1. I add href in this button. But can't work. What can I do? Please help me

    ReplyDelete

Powered by Blogger.