Search code examples
htmltwitter

Twitter icon does not show up in share link


I am looking at these docs:

https://dev.twitter.com/web/tweet-button

I tried a couple of their examples, like so:

<a class="twitter-share-button" href="https://twitter.com/intent/tweet">
  Tweet
</a>

However, this only displays the text "Tweet" without an image. I assume an image is supposed to be included, so what am I missing here?


Solution

  • You are missing the javascript file.

    <script type="text/javascript" async src="https://platform.twitter.com/widgets.js"></script>
    <a class="twitter-share-button" href="https://twitter.com/intent/tweet">
      Tweet
    </a>