Meta Tag in HTML5

 

META TAG:



    The meta tag is a tag in html that describes some aspects of contents of a webpage. The html <meta> is used by search engines to search information. That is provided with the webpage. This empty tag(Singular tag) which carries information within its attributes.

    The meta tag is placed between the <head> and </head> tags. Metadata data will not be displayed on the webpage.

Attributes of <meta> tag-

1.name-

This attribute specifies name of the meta data like keywords,author,copyright or description etc.

The name attribute is related to author,description,keywords and copyright

e.g.<meta name="author">

2.content-

The content attribute of <meta> tag contains its values. The content attribute is used with name attribute to specify meta data about the page.

Values-

<meta name="author" content="ashu">

<meta name="description" content="Advance Web Designing">

<meta name="keywords" content="html5,learn html5,basic tutorial for html5">

3.charset-

It specifies the character encoding by the document. It is also called as a character encoding.

e.g.UTF-8-For Indian Characters

Big5-For Chinese Characters

Values-

<meta charset="UTF-8">

<meta charset="Big5">

4.http-equiv-

Used for http response message headers.

Values-refresh,set-cookie,content-type,expires.

1.<meta http-equiv="refresh" content=10>  -Page get refresh after every 10 seconds

2.<meta http-eqiv="content-type" content="text/html" charset="UTF-8"> -specifies the character encoding foe the document.

Example 1.

 <!DOCTYPE html>

 <html>

 <head>

 <title>Meta tag Example</title>

 <meta name=”authors” content="ashu">

 <meta name=”description” content="Advance Web Designing">

 <meta name=”keywords” content="html5,learn html5,basics of html5">

 <meta name="copyright" content= "copyright Ashu All right Reserve">

 </head>

 <body>

 <p>Welcome to HTML5</p>

 </body>

 </html>

 Example 2-

<head>

<meta charset="UTF-8">

<meta name="description" content="Web Content for Basics">

<meta name="keywords" content="HTML, CSS, JavaScript">

<meta name="author" content="ABC">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>

 

The viewport is the user's visible area of a web page. It varies with the device - it will be smaller on a mobile phone than on a computer screen.



Previous
Next Post »

Please Comment and Share. ConversionConversion EmoticonEmoticon