html · level 3 · unit 4 · lesson 4
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
tags build the card people see when they share a link.
Paste a link into a chat app and a appears: a picture, a title and a line of text. Apps build it from Open Graph tags in your head. Without them, they guess, often badly.
Open Graph tags are <meta> tags with property instead of name: og:title, og:description, og:image, og:url and og:type. Each fact goes in content.
og:image and og:url must be full URLs, because the app reading them is not on your site. A wide picture, about 1200 by 630 pixels, looks best.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Summer fair | Pip's Plants</title>
<meta property="og:title" content="Summer fair at Pip's Plants">
<meta property="og:description" content="Free plant swaps, cake and live music on 14 June.">
<meta property="og:image" content="https://example.com/images/fair.svg">
<meta property="og:url" content="https://example.com/summer-fair">
<meta property="og:type" content="website">
</head>
<body>
<h1>Summer fair</h1>
</body>
</html> Press show my page to see it here.
Chat apps keep a copy of the card, so check your tags before you share the link.
guess first
Which picture will the link preview show?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<head>
<meta property="og:title" content="Puppy training classes">
<meta property="og:image" content="https://example.com/images/puppy-class.svg">
</head>
<body>
<h1>Puppy training classes</h1>
<img src="ball.svg" alt="A chewed tennis ball" width="200" height="200">
</body>
your turn
Your turn. Build the share card.
Fill the three blanks: a title of a few words for the card on line 6, the og:image property on line 7, and the page's full URL in og:url on line 8.
Press show my page to see it here.
- the card has a titlenot checked yet
- the card has a picturenot checked yet
- the card links to a full URLnot checked yet
fix it
The share card has no picture. Can you fix it?
Press show my page to see it here.
- the picture is a full URLnot checked yet
- the card still has a titlenot checked yet
- The chat app is not on your site. Can it find
images/fair.svgfrom that alone? og:imagemust be a full URL, starting withhttps://and the domain.- Change the
contenton line 7 tohttps://example.com/images/fair.svg, then press run.
nailed it
your links look good everywhere. :D
- Open Graph tags build the link preview.
- They use
propertyandcontent. og:imageandog:urlmust be full URLs.
new words in your collection
- link preview
- Open Graph
This lesson isn’t saved. A free account remembers every lesson you finish.