Accessibility Deep Dive
Master WCAG compliance and ARIA attributes. Continue →
Search engines and social media rely on metadata—information about your page. Well-crafted metadata improves search rankings, click-through rates, and how your content appears when shared. This tutorial covers essential meta tags and structured data.
What you’ll learn:
<meta> tag and common attributesPrerequisites:
The <meta> tag provides metadata about your HTML document. It’s in the <head>, not the body.
Always declare UTF-8 as your character encoding:
<meta charset="UTF-8">This must be within the first 1024 bytes of your document and should be the first meta tag.
Make your page responsive:
<meta name="viewport" content="width=device-width, initial-scale=1.0">This tells browsers:
width=device-width — Page width matches device widthinitial-scale=1.0 — Initial zoom level is 100%Your page description appears in search results:
<meta name="description" content="Learn HTML from beginner to advanced. Free tutorials and reference guide.">Best practices:
Though less important now, keywords help search engines:
<meta name="keywords" content="HTML, tutorials, web development, learning">Note: Keyword stuffing doesn’t work. Search engines ignore irrelevant keywords.
Open Graph tags control how your content appears when shared on Facebook, LinkedIn, Pinterest, and other platforms.
Key Open Graph tags:
og:title — Title when shared (different from page title)og:description — Description when sharedog:image — Image URL (minimum 1200x630 pixels)og:url — Canonical URL of the contentog:type — Type of content: website, article, profile, etc.For articles, add publication metadata:
<meta property="article:published_time" content="2024-12-10T14:30:00Z"><meta property="article:modified_time" content="2024-12-11T10:00:00Z"><meta property="article:author" content="https://example.com/author/john"><meta property="article:section" content="Technology"><meta property="article:tag" content="HTML"><meta property="article:tag" content="Web Development">Control how your content appears on Twitter:
Twitter Card types:
summary — Title, description, thumbnailsummary_large_image — Same as summary but with large imageplayer — For video/audio contentapp — For mobile app promotionJSON-LD (JSON for Linking Data) helps search engines understand your content. It’s the recommended format by Google and other search engines.
<script type="application/ld+json">{ "@context": "https://schema.org", "@type": "Organization", "name": "Example Company", "url": "https://example.com", "logo": "https://example.com/logo.png", "sameAs": [ "https://www.facebook.com/example", "https://www.twitter.com/example", "https://www.linkedin.com/company/example" ], "contactPoint": { "@type": "ContactPoint", "contactType": "Customer Service", "telephone": "+1-555-123-4567", "email": "[email protected]" }}</script><script type="application/ld+json">{ "@context": "https://schema.org/", "@type": "Product", "name": "Widget XL", "image": "https://example.com/widget.jpg", "description": "An excellent widget", "brand": { "@type": "Brand", "name": "Widget Corp" }, "offers": { "@type": "Offer", "price": "29.99", "priceCurrency": "USD" }, "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.5", "reviewCount": "89" }}</script>Control how search engines handle your page:
<!-- Index this page, follow links --><meta name="robots" content="index, follow">
<!-- Don't index this page --><meta name="robots" content="noindex, nofollow">
<!-- Index but don't follow external links --><meta name="robots" content="index, nofollow">
<!-- Don't show in search snippets longer than 160 chars --><meta name="robots" content="max-snippet:-1, max-image-preview:large">Specify the page language:
<html lang="en"><meta http-equiv="Content-Language" content="en-US">Tell search engines this is the preferred version of a page:
<link rel="canonical" href="https://example.com/page">Use this when you have similar content at multiple URLs.
Redirect after a delay (use sparingly):
<!-- Redirect after 5 seconds --><meta http-equiv="refresh" content="5; url=https://example.com/new-location"><!-- Good --><title>HTML Tutorial for Beginners - Learn Web Development</title>
<!-- Bad --><title>Page</title>Good: https://example.com/tutorials/html/basicsBad: https://example.com/page.php?id=123<h1> per page<h1>Learning HTML: A Beginner's Guide</h1><h2>Getting Started</h2><h3>Installing a Text Editor</h3><!-- Good --><a href="/tutorials/css">Learn CSS after HTML</a>
<!-- Bad --><a href="/tutorials/css">click here</a>Create a complete meta tag setup:
Accessibility Deep Dive
Master WCAG compliance and ARIA attributes. Continue →
SEO Optimization
Advanced technical SEO with HTML. Continue →