HTML meta tags
So webpages have data, but how do we describe that data? A description of the data on a webpage may often be important for search engines as well as for users.
This lesson focuses on:
- The <meta> tag
The <meta> tag
The <meta> tag is one of the most important tags in HTML. The <meta> tag is used to describe the page in some way as well as other things such as refreshing a page automatically after a certain amount of time, and preventing webpages from being displayed in another websites frames page. Some of the things that can be described using the <meta> tag include the pages author, the software used to create the page, and a description of the content on the page.
NOTE: The <meta> tag goes in the head section of an HTML document and has no end tag.
Attributes of the <meta> tag:
-
name
This attribute is used to connect the content attribute to a name.
-
http-equiv
This attribute is used to connect the content attribute to HTTP headers. The http-equiv attribute is used to tell the browser certain things about webpages such as how often should a webpage be refreshed.
-
content
This attribute defines data to be associated with the name or http-equiv attributes. When associating data with the name attribute, this attribute stores data about webpages that will be passed to search engines, such as the author of a webpage or the description of a webpage. When associating data with the http-equiv attribute, this attribute stores data about webpages that will be passed to the web browser such as how often to refresh a webpage or when a webpage expires.
Examples of the <meta> tag utilizing the name and content attributes
Offering keywords to search engines that can be used in their searches:
<meta name="keywords" content="apple, orange, fruit" />
Offering a description of a webpage to search engines:
<meta name="description" content="A fruit store for all! whether you prefer pears, oranges, grapes, or any other fruit, we have something for everyone!" />
Telling search engines what software was used to create a webpage:
<meta name="generator" content="Notepad" />
Telling search engines who created a webpage:
<meta name="author" content="Someone A. Person" />
Telling search engines when to expire a webpage in their databases:
<meta name="expires" content="February 1st, 2876" />
Examples of the <meta> tag utilizing the http-equiv and content attributes
Reloading the current page every five seconds:
<meta http-equiv="refresh" content="5" />
Preventing a webpage from being viewed inside some other websites frames page:
<meta http-equiv="window-target" content="_top" />
Examples
Page author
This example demonstrates declaring who is the author of a webpage.
Page description
This example demonstrates declaring a description for a webpage.
Page expiration
This example demonstrates declaring an expiration date for a webpage to be used by search engines.
Page generator
This example demonstrates specifying the software that was used to create a webpage.




