Login Register
Code2night
  • Home
  • Blog Archive
  • Learn
    • Tutorials
    • Videos
  • Interview Q&A
  • Languages
    • Angular
    • C
    • c#
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • Security
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
    • SEO Analyzer
    • Background Remover
  1. Home
  2. Blog
  3. How to Add a WhatsApp Share Button on Your Website

How to Add a WhatsApp Share Button on Your Website

Date- Aug 22,2022

19290

Free Download Pay & Download
apiwhatsappcom Share to whatsapp

For adding the whatsapp share button we just need one anchor tag and then we have to know how to use api.whatsapp.com to share the link. So starting from the beginning you can add this fontawesome css on your page.

To use the Font Awesome icons, add the following line inside your HTML page:

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

Now we will add anchor tag to create share to whatsapp button . So you can copy Code for  WhatsApp share button . You have to specify the url which you want to share in the href tag ,that url will be shared automatically on whatsapp when you will click on that.

        <a class="whts" href="https://api.whatsapp.com/send?text=https://www.code2night.com/" data-action="share/whatsapp/share">
            <i class="fa fa-whatsapp"></i>
        </a>

Now we will just add some styling for whatsapp icon.The style for fa fa-whatsapp icon 

<style>
    .fa-whatsapp {
        color: #fff;
        background: linear-gradient(#25d366,#25d366) 14% 84%/16% 16% no-repeat, radial-gradient(#25d366 60%,transparent 0);
    }

    a.whts {
        font-size: 38px;
        margin: 35px;
        vertical-align: top;
        position: relative;
        top: 2px;
    }
</style>

to share the link on whats app click on the share button then a new window will pop up click on continue with chat then the new popup will open then click on use WhatsApp web then share your message.

In mobile apps it will directly open whatsapp if installed in your system. So this is how to add a WhatsApp share button on a website .

 


S
Shubham Batra
Programming author at Code2Night โ€” sharing tutorials on ASP.NET, C#, and more.
View all posts โ†’

Related Articles

Responsive Slick Slider
Jul 28, 2022
Create a Slick Slider with a Single Slide: Step-by-Step
May 09, 2021
Create a Code Syntax Highlighter Using Prism.js: Complete Guide
Dec 12, 2020
Complete Guide to Building a Music Player in HTML/CSS
Sep 04, 2021
Previous in HTML/CSS
Responsive Slick Slider
Next in HTML/CSS
How to Create a Table with Fixed Header and Scrollable Body in HT…

Comments

Contents

๐ŸŽฏ

Interview Prep

Ace your HTML/CSS interview with curated Q&As for all levels.

View HTML/CSS Interview Q&As

More in HTML/CSS

  • How to Create a Table with Fixed Header and Scrollable Body … 6395 views
  • Free PHP, HTML, CSS, JavaScript/TypeScript editor - CodeLobs… 4900 views
  • Child Internet Safety: A Complete Guide for Developers 4314 views
  • Complete Guide to Creating a Registration Form in HTML/CSS 4013 views
  • Mastering CSS: A Complete Guide with Examples in HTML/CSS 3673 views
View all HTML/CSS posts โ†’

Tags

AspNet C# programming AspNet MVC c programming AspNet Core C software development tutorial MVC memory management Paypal coding coding best practices data structures programming tutorial tutorials object oriented programming Slick Slider StripeNet
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blog Archive
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
  • SEO Analyzer
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
  • SEO Analyzer
By Language
  • Angular
  • C
  • c#
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • Security
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ยท  Terms
Translate Page
We use cookies to improve your experience and analyze site traffic. By clicking Accept, you consent to our use of cookies. Privacy Policy
Accessibility
Text size
High contrast
Grayscale
Dyslexia font
Highlight links
Pause animations
Large cursor