HTML Basics

HTML Introduction HTML Basic HTML Comments HTML Tags/Elements HTML Attributes HTML Formatting HTML Block and Inline HTML Charsets HTML Classes HTML Colors HTML Div HTML Headings HTML Id HTML Iframes HTML Images HTML File Paths HTML Tables HTML Layout HTML Lists HTML Links <a> HTML Paragraphs HTML Quotations HTML JavaScript HTML Emojis HTML URL Encode HTML Entities HTML Computercode HTML Symbols HTML Styles

HTML Forms

HTML Forms HTML Form Elements HTML Form Attributes HTML Input Attributes HTML Input Regex HTML Input Form Attributes HTML Input Types

HTML SEO

HTML Head HTML Page Title HTML Responsive HTML Semantics HTML Favicon

HTML Graphics

HTML Canvas HTML SVG

HTML Media

HTML Media HTML Audio HTML Video

HTML Reference

a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl DOCTYPE dt em embed fieldset figcaption figure font footer form frame frameset h1_-_h6 head header hgroup hr html i iframe img input ins kbd label legend li link main map mark menu meta meter nav noframes noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr

HTML <meta> Tag

The tag is an important HTML tag that provides metadata about the document. Metadata includes information such as character set, author, description, and keywords. This information helps search engines, browsers, and other web services understand and index the page properly.

How to Use the <meta> Tag

The <meta> tag is a self-closing tag that goes inside the <head> section of an HTML document. It does not have a closing tag. Here is an example of how to use the <meta> tag to specify the character set of the document:

<meta charset="UTF-8">

In this example, the charset attribute specifies that the character encoding of the document is UTF-8.

Main Attributes of the <meta> Tag

Attribute Description
charset Specifies the character encoding of the document
name Specifies the name of the metadata
content Specifies the value of the metadata
http-equiv Provides an HTTP header for the information/value of the content attribute

Here is an example of how to use the <meta> tag with the name and content attributes to specify the author of the document:

<meta name="author" content="John Doe">

In this example, the name attribute specifies that the metadata is the author of the document, and the content attribute specifies the value of the author's name, which is "John Doe".

Another common use of the <meta> tag is to specify the description of the document for search engines. Here is an example:

<meta name="description" content="This is a tutorial on HTML meta tags">

In this example, the name attribute specifies that the metadata is the description of the document, and the content attribute specifies the actual description text.

Conclusion

The <meta> tag is a crucial element in HTML that provides important metadata about a document. By using the <meta> tag effectively, you can improve the visibility and indexing of your web pages on search engines.