Defining Meta Tag Descriptions in HTML

Defining Meta Tag Descriptions

Search engines use the <meta> tag’s description of the document for indexing and ranking purposes. Some search engines also display the description entries underneath the links on results pages.

Below the first meta tag insert another <meta> tag. Add the name attribute to your <meta> tag and set it equal to “description”, Now, your document should look like the below

<html>
<head>
<title>HTML in 10 Simple Steps or Less</title>
<meta name=”keywords” content=”HTML,HTML tutorials,CSS Tutorials” />
<meta name=”description”>
</head>
<body>
</body>
</html>

Now, add the content attribute, to add a description. Set the content attribute by adding a short piece of descriptive text,

<html>
<head>
<title>HTML in 10 Simple Steps or Less</title>
<meta name=”keywords” content=”HTML,HTML tutorials, CSS Tutorials” />
<meta name=”description” content=”Free tutorials for beginners” >
</head>
<body>
</body>
</html>

To make the <meta> tag both XHTML-compliant and still recognizable to browsers that don’t yet support XHTML, insert a space and forward slash at the end of the tag, as shown:

<meta name=“description” content=“Free tutorials for beginners” />

If you want to put Author name in your document, you can also do this by adding <meta> tags. Add a meta tag below the description meta tag and set author name

<html>
<head>
<title>HTML in 10 Simple Steps or Less</title>
<meta name=”keywords” content=”HTML,HTML tutorials, CSS Tutorials” />
<meta name=”description” content=“Free tutorials for beginners” />
<meta name=”author” content=“Kaushal Arwal”>
</head>
<body>
</body>
</html>