Search code examples
htmlmeta-tags

Html image in a meta tag


I'm using discord, and I saw a lot of people do that thing (the big square in the image). I tried to do that in html with meta tag, but it came out with the result (image number 2). I really want to know how to do this, can someone please help me?

Image number one | image number two

And there is the code I use for doing this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
  <meta property="og:title" content="An Image By ItsJustOne#9817">
<meta property="og:description" content="Remember always that there is an end in the tunnel 🥰">
<meta property="og:image" content="https://cdn.discordapp.com/banners/907132383814377502/4aca154cd6040b31aacaaf781877f121.png?size=1024">
    <meta name="viewport" content="width=device-width">
    <title>Why You Are Here?</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    Why You Are Here?
    <script src="script.js"></script>
  </body>
</html>

The image I'm trying to use is my discord banner.


Solution

  • It was 4 months ago, and I forgot to write here that I found a solution a week after asking here!

    The solution is simple, using other meta tags, not the regular. The twitter meta tags.

    <meta name="twitter:title" content="Title">
    <meta name="twitter:description" content="Cool description">
    <meta name="twitter:image" content="the image link">
    <meta name="twitter:card" content="summary_large_image">
    

    Replace there the title, description, and the image link.