The <meta name="description"> tag provides a brief summary of your web page's content.
While it doesn't change how your page looks to the user, it is one of the most important tags for SEO (Search Engine Optimization). Here is exactly what it does:
1. It creates the "Snippet" on Google
When you search for something on Google, each result has a blue title and a few lines of black text below it. That black text is usually pulled directly from the <meta name="description"> tag.
- Example:
On Google, a user would see exactly that sentence describing your page.<meta name="description" content="Learn how to format text in HTML using headings, paragraphs, and bold tags in this free LabEx tutorial.">
2. It helps with "Click-Through Rate"
If your description is clear and interesting, more people will click on your link. It acts like a sales pitch for your website in the search results.
3. It shows up on Social Media
When you share a link to your website on platforms like Discord, Slack, or LinkedIn, they often use this description to show a preview of what the link is about.
Important Rules:
- Length: It should stay between 140–160 characters. If it's too long, Google will cut it off with
.... - Location: It must always be placed inside the
<head>section:<head> <title>HTML Formatting Lab</title> <meta name="description" content="A guide to HTML text formatting."> </head>
In short: It tells the outside world (like Google and social media) what is happening inside your web page