How to Write Social Media Buttons

Learn how to create effective social media share buttons to enhance your online presence and engagement.

How to Write Social Media Buttons
How to Write Social Media Buttons

Social Media Buttons

We’ve designed multiple versions of social media share buttons to boost engagement and SEO: inline buttons, icon-based circular buttons, rectangular icon buttons, and a sticky floating sidebar. These share buttons are compatible with all major platforms, including Facebook, Twitter, LinkedIn, Pinterest, WhatsApp, Reddit, and Email. You can easily embed them into websites built with WordPress (via Custom HTML or theme editor), Wix (using Embed Code blocks), Hostinger Website Builder, or any custom HTML/CSS project. Enhance your site’s interactivity and social reach with clean, responsive, mobile-friendly button designs that are easy to install and customize.

How to Write Social Media Button Codes

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Social Share Buttons</title>

<style>

.share-buttons {

display: flex;

justify-content: center;

align-items: center;

flex-wrap: wrap;

padding: 10px;

}

.share-buttons a {

display: inline-block;

padding: 10px 20px;

margin: 5px;

text-decoration: none;

color: white;

border-radius: 5px;

font-family: Arial, sans-serif;

font-size: 14px;

text-align: center;

width: 120px;

}

.share-facebook { background-color: #3b5998; }

.share-twitter { background-color: #1da1f2; }

.share-linkedin { background-color: #0077b5; }

.share-pinterest { background-color: #bd081c; }

.share-whatsapp { background-color: #25d366; }

.share-email { background-color: #d44638; }

.share-reddit { background-color: #ff4500; }

.share-buttons a:hover {

opacity: 0.9;

}

</style>

</head>

<body>

<div class="share-buttons">

<a class="share-facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://www.domain.com" target="_blank">Facebook</a>

<a class="share-twitter" href="https://twitter.com/intent/tweet?url=https://www.domain.com" target="_blank">Twitter</a>

<a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://www.domain.com" target="_blank">LinkedIn</a>

<a class="share-pinterest" href="https://pinterest.com/pin/create/button/?url=https://www.domain.com" target="_blank">Pinterest</a>

<a class="share-whatsapp" href="https://api.whatsapp.com/send?text=https://www.domain.com" target="_blank">WhatsApp</a>

<a class="share-email" href="mailto:?subject=Check this out&body=https://www.domain.com" target="_blank">Email</a>

<a class="share-reddit" href="https://reddit.com/submit?url=https://www.domain.com" target="_blank">Reddit</a>

</div>

</body>

</html>

The Code Will Look Like:

🔧 Customization Tips:

  • Change https://www.usadmission.net to your actual page or article URL.

  • You can insert this into any .html file or embed it in a WordPress site using a Custom HTML block.

How to Write Social Media Button Codes

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Share This Page</title>

<style>

.share-buttons {

display: flex;

justify-content: center;

align-items: center;

flex-wrap: wrap;

padding: 10px;

}

.share-buttons a {

display: inline-block;

padding: 10px 20px;

margin: 5px;

text-decoration: none;

color: white;

border-radius: 5px;

font-family: Arial, sans-serif;

font-size: 14px;

text-align: center;

width: 120px;

}

.share-facebook { background-color: #3b5998; }

.share-twitter { background-color: #1da1f2; }

.share-linkedin { background-color: #0077b5; }

.share-pinterest { background-color: #bd081c; }

.share-whatsapp { background-color: #25d366; }

.share-email { background-color: #d44638; }

.share-reddit { background-color: #ff4500; }

.share-buttons a:hover {

opacity: 0.9;

}

</style>

</head>

<body>

<div class="share-buttons">

<a class="share-facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://focusinsight.net/mohammad-sa" target="_blank">Facebook</a>

<a class="share-twitter" href="https://twitter.com/intent/tweet?url=https://focusinsight.net/mohammad-sa" target="_blank">Twitter</a>

<a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://focusinsight.net/mohammad-sa" target="_blank">LinkedIn</a>

<a class="share-pinterest" href="https://pinterest.com/pin/create/button/?url=https://focusinsight.net/mohammad-sa" target="_blank">Pinterest</a>

<a class="share-whatsapp" href="https://api.whatsapp.com/send?text=https://focusinsight.net/mohammad-sa" target="_blank">WhatsApp</a>

<a class="share-email" href="mailto:?subject=Check this out&body=https://focusinsight.net/mohammad-sa" target="_blank">Email</a>

<a class="share-reddit" href="https://reddit.com/submit?url=https://focusinsight.net/mohammad-sa" target="_blank">Reddit</a>

</div>

</body>

</html>

The Code Will Look Like:
What to write the social media buttons code for a real scenario;
How to Write Social Media Button Codes

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Share This Page</title>

<!-- Load Font Awesome Icons -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<style>

.share-buttons {

display: flex;

justify-content: center;

align-items: center;

flex-wrap: wrap;

gap: 10px;

padding: 10px;

}

.share-buttons a {

display: flex;

align-items: center;

justify-content: center;

width: 50px;

height: 50px;

color: white;

border-radius: 50%;

font-size: 20px;

text-decoration: none;

}

.share-facebook { background-color: #3b5998; }

.share-twitter { background-color: #1da1f2; }

.share-linkedin { background-color: #0077b5; }

.share-pinterest { background-color: #bd081c; }

.share-whatsapp { background-color: #25d366; }

.share-email { background-color: #d44638; }

.share-reddit { background-color: #ff4500; }

.share-buttons a:hover {

opacity: 0.85;

}

</style>

</head>

<body>

<div class="share-buttons">

<a class="share-facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Facebook">

<i class="fab fa-facebook-f"></i>

</a>

<a class="share-twitter" href="https://twitter.com/intent/tweet?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Twitter">

<i class="fab fa-twitter"></i>

</a>

<a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on LinkedIn">

<i class="fab fa-linkedin-in"></i>

</a>

<a class="share-pinterest" href="https://pinterest.com/pin/create/button/?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Pin on Pinterest">

<i class="fab fa-pinterest-p"></i>

</a>

<a class="share-whatsapp" href="https://api.whatsapp.com/send?text=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on WhatsApp">

<i class="fab fa-whatsapp"></i>

</a>

<a class="share-email" href="mailto:?subject=Check this out&body=https://focusinsight.net/mohammad-sa" target="_blank" title="Send via Email">

<i class="fas fa-envelope"></i>

</a>

<a class="share-reddit" href="https://reddit.com/submit?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Reddit">

<i class="fab fa-reddit-alien"></i>

</a>

</div>

</body>

</html>

The Buttons Will Look Like:
What to write the social media buttons code for a real scenario;
Circular and icon-based social media share buttons

You can make necessary changes in margin, padding, domain, etc.

How to Write Social Media Button Codes: Rectangular Icon-Based Share Buttons

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Share This Page</title>

<!-- Load Font Awesome Icons -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<style>

.share-buttons {

display: flex;

justify-content: center;

align-items: center;

flex-wrap: wrap;

gap: 10px;

padding: 10px;

}

.share-buttons a {

display: flex;

align-items: center;

justify-content: center;

width: 90px;

height: 50px;

color: white;

border-radius: 8px; /* Rectangle with soft corners */

font-size: 20px;

text-decoration: none;

}

.share-facebook { background-color: #3b5998; }

.share-twitter { background-color: #1da1f2; }

.share-linkedin { background-color: #0077b5; }

.share-pinterest { background-color: #bd081c; }

.share-whatsapp { background-color: #25d366; }

.share-email { background-color: #d44638; }

.share-reddit { background-color: #ff4500; }

.share-buttons a:hover {

opacity: 0.85;

}

</style>

</head>

<body>

<div class="share-buttons">

<a class="share-facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Facebook">

<i class="fab fa-facebook-f"></i>

</a>

<a class="share-twitter" href="https://twitter.com/intent/tweet?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Twitter">

<i class="fab fa-twitter"></i>

</a>

<a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on LinkedIn">

<i class="fab fa-linkedin-in"></i>

</a>

<a class="share-pinterest" href="https://pinterest.com/pin/create/button/?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Pin on Pinterest">

<i class="fab fa-pinterest-p"></i>

</a>

<a class="share-whatsapp" href="https://api.whatsapp.com/send?text=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on WhatsApp">

<i class="fab fa-whatsapp"></i>

</a>

<a class="share-email" href="mailto:?subject=Check this out&body=https://focusinsight.net/mohammad-sa" target="_blank" title="Send via Email">

<i class="fas fa-envelope"></i>

</a>

<a class="share-reddit" href="https://reddit.com/submit?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Reddit">

<i class="fab fa-reddit-alien"></i>

</a>

</div>

</body>

</html>

The Buttons Will Look Like:
What to write the social media buttons code for a real scenario;
Circular and icon-based social media share buttons

You can make necessary changes in margin, padding, domain, etc.

✅ Key Changes made:

  • border-radius: 8px instead of 50% (rectangle with rounded corners)

  • width: 100px for a clear rectangular shape

✅ Rectangular Icon-Based Social Media Share Buttons
How to Write Social Media Button Codes: Rectangular Icon-Based Share Buttons

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Share This Page</title>

<!-- Load Font Awesome Icons -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<style>

.share-buttons {

display: flex;

justify-content: center;

align-items: center;

flex-wrap: wrap;

gap: 10px;

padding: 10px;

}

.share-buttons a {

display: flex;

align-items: center;

justify-content: center;

width: 90px;

height: 50px;

color: white;

border-radius: 8px; /* Rectangle with soft corners */

font-size: 20px;

text-decoration: none;

}

.share-facebook { background-color: #3b5998; }

.share-twitter { background-color: #1da1f2; }

.share-linkedin { background-color: #0077b5; }

.share-pinterest { background-color: #bd081c; }

.share-whatsapp { background-color: #25d366; }

.share-email { background-color: #d44638; }

.share-reddit { background-color: #ff4500; }

.share-buttons a:hover {

opacity: 0.85;

}

</style>

</head>

<body>

<div class="share-buttons">

<a class="share-facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Facebook">

<i class="fab fa-facebook-f"></i>

</a>

<a class="share-twitter" href="https://twitter.com/intent/tweet?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Twitter">

<i class="fab fa-twitter"></i>

</a>

<a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on LinkedIn">

<i class="fab fa-linkedin-in"></i>

</a>

<a class="share-pinterest" href="https://pinterest.com/pin/create/button/?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Pin on Pinterest">

<i class="fab fa-pinterest-p"></i>

</a>

<a class="share-whatsapp" href="https://api.whatsapp.com/send?text=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on WhatsApp">

<i class="fab fa-whatsapp"></i>

</a>

<a class="share-email" href="mailto:?subject=Check this out&body=https://focusinsight.net/mohammad-sa" target="_blank" title="Send via Email">

<i class="fas fa-envelope"></i>

</a>

<a class="share-reddit" href="https://reddit.com/submit?url=https://focusinsight.net/mohammad-sa" target="_blank" title="Share on Reddit">

<i class="fab fa-reddit-alien"></i>

</a>

</div>

</body>

</html>

The Buttons Will Look Like:
What to write the social media buttons code for a real scenario;
Circular and icon-based social media share buttons

You can make necessary changes in margin, padding, domain, etc.

✅ What's Included:

  • A gray "share" button as a placeholder using <i class="fas fa-share-alt"></i>

  • Fully rectangular icon buttons for 7 platforms

✅ Full HTML Code: Rectangular Icon-Based Share Buttons with Placeholder
How to Write Social Media Button Codes: Floating Sidebar Social Buttons

<!-- Floating Sidebar Social Buttons -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<style>

.floating-share {

position: fixed;

top: 0;

left: 0;

height: 100vh;

width: 50px;

background: ;

display: flex;

flex-direction: column;

justify-content: space-evenly;

align-items: center;

z-index: 999;

}

.floating-share a {

display: flex;

align-items: center;

justify-content: center;

width: 40px;

height: 40px;

margin: 6px 0;

color: white;

text-decoration: none;

font-size: 18px;

border-radius: 5px;

}

.share-facebook { background-color: #3b5998; }

.share-twitter { background-color: #1da1f2; }

.share-linkedin { background-color: #0077b5; }

.share-pinterest { background-color: #bd081c; }

.share-whatsapp { background-color: #25d366; }

.share-email { background-color: #d44638; }

.share-reddit { background-color: #ff4500; }

.floating-share a:hover {

opacity: 0.9;

}

</style>

<div class="floating-share">

<a class="share-facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://focusinsight.net/mohammad-sa" target="_blank"><i class="fab fa-facebook-f"></i></a>

<a class="share-twitter" href="https://twitter.com/intent/tweet?url=https://focusinsight.net/mohammad-sa" target="_blank"><i class="fab fa-twitter"></i></a>

<a class="share-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=https://focusinsight.net/mohammad-sa" target="_blank"><i class="fab fa-linkedin-in"></i></a>

<a class="share-pinterest" href="https://pinterest.com/pin/create/button/?url=https://focusinsight.net/mohammad-sa" target="_blank"><i class="fab fa-pinterest-p"></i></a>

<a class="share-whatsapp" href="https://api.whatsapp.com/send?text=https://focusinsight.net/mohammad-sa" target="_blank"><i class="fab fa-whatsapp"></i></a>

<a class="share-email" href="mailto:?subject=Check this out&body=https://focusinsight.net/mohammad-sa" target="_blank"><i class="fas fa-envelope"></i></a>

<a class="share-reddit" href="https://reddit.com/submit?url=https://focusinsight.net/mohammad-sa" target="_blank"><i class="fab fa-reddit-alien"></i></a>

</div>

The buttons Will Look Like:

What to write the social media buttons code for a real scenario;
Floating Sidebar Social Buttons
Floating Sidebar Social Buttons codes