HTML - Meta Tag

Meta Tag


<meta> tag is used to add a description of HTML page. The description that we add about the web page using the <meta> is used by search engines for indexing and ranking the web page.
<meta> tags always go inside the <head> element.
Meta Data includes Document Title, Keywords, Description, Author Information, Last Modified Date, etc. Apart from this, you can describe hundreds of types of Meta Data about an HTML Document.

Importance of Meta Tag


1. Document Title, Content Description (Summary), Keywords, etc. are defined by Meta Tag.

2. Robots can be used to indicate content that you want a "no-index" or "no follow".

3. The viewport (screen visible to the readers) setting is defined by Meta Tag.
4. Meta Data is also required for SEO - Search Engine Optimization.


Meta Tag Attribute 


1. charset: Specifies the character encoding for the HTML document.

2. content: Gives the value associated with the Http-equiv or name attribute.

3. Http-Equiv: Provides an HTTP header for the information & value of the content attribute.

4. nameName attribute used for Specifies a name for the metadata.


Description Meta Tag


Define a description of your web page.

Example :

 <!DOCTYPE HTML>
<html>
<head>
<title>www.tutorialsug.com </title>
<meta name="description" content="A website about programming language">
</head>
<body>
</body>
</html>

Keyword Meta Tag


Meta Keyword is used to specify the important keyword is related to the HTML document.

Example :
 <!DOCTYPE HTML>
<html>
<head>
<title>www.tutorialsug.com </title>
<meta name="keywords" content="HTML, SQL, CSS">
</head>
<body>
</body>
</html>

Viewport Meta Tag


The viewport is used to design a responsive website/blog.


Example :
 <!DOCTYPE HTML>
<html>
<head>
<title>www.tutorialsug.com </title>
<meta name="viewport" content="width=device-width,intial-scale=1.0">
</head>
<body>
</body>
</html>

Document Refreshing


The meta tag is used to specify a duration after which the web page will keep refreshing automatically after the given duration. The code to refresh web page after 5 sec is given below:

Example:
 <!DOCTYPE HTML>
<html>
<head>
<title>www.tutorialsug.com </title>
<meta http-equiv="refresh" content="5">
</head>
<body>
</body>
</html>

Post a Comment

0 Comments