Social media buttons without JavaScript

You don’t need JavaScript to add social media buttons to your website. But I see JavaScript-based social buttons on websites every day. And these buttons are not about privacy. Let’s see how to create such buttons using <a href="...">.


<a href=",css&via=dev_tip" target="_blank">
    Share on Twitter


The complete text of the tweet will be Awesome article #html #css via @dev_tip.

Documentation: Tweet button


<a href="" target="_blank">
    Share on Facebook


Unfortunately, the Facebook sharer no longer supports any customization. If you need custom text, try to use Dialog for that:

But this way requires app_id, so you have to register your Facebook app. Not very friendly.

Documentation: Facebook Share


<a href="" target="_blank">
    Share in VK


Documentation: VK Link Posting


<a href="" target="_blank">
    Share in LinkedIn


Documentation: Share Plugin


I also add these attributes to my share links:

Webmentions [?]

  1. Незачем тащить на сайт всякий JavaScript от социальных сетей, если вам просто нужно добавить кнопку «Поделиться». Соц. сети умеют в ссылки.

  2. MarryCherry

    Учусь пока работаю, учусь пока сижу в твиттере 😅. Отдельная любовь - внимание к мелочам

  3. Tibor Martini

    For Facebook you can use the parameter e to send custom text along. It is rendered in Facebook as a quote of the shared link.

  4. Amber Weinberg Jones

    Yep I never ever use JS or widgets to add share buttons.

  5. Guillaume Le Nistour

    Social media buttons without JavaScript | Dev Tips…

  6. Colin 't Hart

    What about Instagram?

  7. Станислав

    фронтендеры придумали тег a-href

  8. Tatweer Development

    Tnx. İt's just what I've been looking for to my project right now!

  9. AFAIK, Instagram hasn’t any way to share anything via link. But you can add a link to the post related to your website as an option.

  10. pig

    Social media buttons without JavaScript by @dev_tip…