Home › Guides › How to add a WhatsApp button to your website (HTML and CSS)

How to add a WhatsApp button to your website (HTML and CSS)

A WhatsApp button doesn't need a plugin or a third-party script. It is an ordinary link with a bit of styling. Here are two versions ready to copy.

Published on October 6, 2026 · By the QLinky team

Version 1: button inside the content

Replace the number and the message with your own (or generate the link with QLinky and paste the URL in the href).

<a class="btn-whatsapp"
   href="https://wa.me/13051234567?text=Hi%2C%20I%27d%20like%20some%20information"
   target="_blank" rel="noopener">
  Message us on WhatsApp
</a>
.btn-whatsapp {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  background: #128c7e;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.btn-whatsapp:hover { background: #0e6f64; }

Version 2: floating button in a corner

It stays fixed at the bottom right while the person scrolls the page.

<a class="wa-floating"
   href="https://wa.me/13051234567"
   target="_blank" rel="noopener"
   aria-label="Open WhatsApp chat">
  WhatsApp
</a>
.wa-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  padding: 14px 18px;
  border-radius: 999px;
  background: #128c7e;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

Details that make the difference

Where to paste it on your platform

How to know whether people use it

A click on the button is a click to another domain. Google Analytics 4 records those outbound clicks automatically if you have enhanced measurement turned on, and you can filter them by destination URL.

Try it now

Generate your link for free, with no sign-up and without your data leaving the browser.

WhatsApp link generator with message and QR code

Other guides

See all guides →