1. Home
  2. Banking
  3. Tax
  4. Forms
  5. ppf - ssy
  6. Sr. Citizen
  7. Widgets
  8. Misc.
Home  ❯  Misc.  ❯  This Page

Easy Social Media Share Buttons for Web Page

Add Social Share buttons to your Webpage in an Easy Way by only CSS and plain JavaScript. The code automatically writes URL and Titel text of the page being shared. The code given on this page includes CSS and JavaScript Code for adding Social Media buttons for Facebook, Twitter, WhatApp and Linkedin. You may add more buttons by visiting the website of the social media page to get the "Share URL" and amend the CSS and JavaScript Code given below.

Demo of Share buttons

How to Add Social Media Share buttons :

  1. Get Font Awesome for Social Media icons. The code is given below.
  2. Copy the CSS Code given below in the Head of the page or include it in your main CSS file.
  3. Copy the Javascript Code given below in the Head of the page or include it in your main JS file.
  4. Create <div id='share1' class='sharebutton'></div> in the body of the page where you want Share Buttons to appear.
  5. The Javascript code will automatically add Share Buttons on Window Load.


Updated : Mar 01 , 2021