Solution: CSS Floating Social Share Button using HTML, CSS & JavaScript with source code, demo, and also how you can execute full program easily. To complete the program you need to follow those steps given bellow
Live Demo
Also Helpful –
How to Create CSS Floating Social Share Button
Description
Back to coding, To complete this program with debugging free code you have to create three files. The first file is to HTML and the second file gonna be CSS for design part and the third file JavaScript for function-related,
index.html
Create an HTML file named ‘index.html‘ and put those codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<!-- Coding Debugging (https://codingdebugging.com) --> <!DOCTYPE html> <html> <head> <title>Floating Share Buttons - Coding Debugging</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- My Stylesheet --> <link rel="stylesheet" href="style.css"> <!-- Font Awesome Icon --> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"> <!-- jQuery Min.JS --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <div class="main"> <div class="sm-container"> <i class="show-btn fas fa-user"></i> <div class="sm-menu"> <a href=""><i class="fab fa-facebook-f"></i></a> <a href=""><i class="fab fa-twitter"></i></a> <a href=""><i class="fab fa-instagram"></i></a> <a href=""><i class="fab fa-youtube"></i></a> <a href=""><i class="fab fa-whatsapp"></i></a> </div> </div> </div> <!-- JavaScript Page --> <script src="function.js" type="text/javascript"></script> </body> </html> |
style.css
Create a CSS file named ‘style.css‘ and put those codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
body{ margin: 0; padding: 0; background: #FF6161; } .main{ position: absolute; top: 25%; left: 2%; transform: translate(-50%,-50%); } .sm-container{ text-align: center; } .sm-container i{ color: #f5f6fa; padding: 20px; font-size: 20px; cursor: pointer; transition: 0.4s; } .sm-container i:hover{ transform: scale(1.2); } .sm-menu{ background: #487eb0; position: absolute; border-radius: 8px; display: none; } .sm-menu::before{ content: ""; width: 10px; height: 10px; background: #487eb0; position: absolute; top: -5px; left: 50%; transform: translateX(-50%) rotate(45deg); } |
function.js
Create a JavaScript file named ‘function.js‘ and put those codes given below.
1 2 3 |
$(".show-btn").click(function(){ $(".sm-menu").fadeToggle("fast"); }); |
Thank you for visiting!
We appreciate you for your precious time. I hope you are learn something from here! If you have any queries about this coding comment down below we will reply ASAP.
Keep coding, Keep debugging!