Meta Element (Meta Tag)

Meaning / Use

If you use the meta elements, also called meta tags, you can add information to your website which is solely interpreted by either web-browsers or search-engines only.

There are a large number of different meta element attributes, although only a handful of attributes are relevant for the rankings.

Source code markup

The markup for meta-data in the source code of an HTML document is as follows:

<elementname attribut="value"></elementname>

The meta element with the attribute “description” would look like this:

<meta name="description" content="Page description">

Various types of meta-element attributes within the source code of an HTML document (Screenshot):

Source code: HTML markup in an editor

Source code: HTML markup in an editor

Differences between HTML and XHTML markup

If you use a XHTML-doctype, you have to close the meta elements with a so-called “trailing slash” (/) in the markup.

HTML Syntax

<meta name="description" content="Page description">

xHTML Syntax

<meta name="description" content="Page description" />

Common misconception

When it comes to web development, you have to differentiate between tags, elements, and attributes. Sadly, these concepts are not only used incorrectly by strangers to the field and newbies. This is the reason why the incorrect term “meta-tags” has pretty much been established even though it is wrong in respect to the meta-element.

The correct definition would be that meta-data are elements within the part of an HTML document. This makes them meta-elements and not “meta-tags”.