03/01/2020

Meta Tag of HTML | Meta Tag Attributes | Studywow

Studywow: Topic= Meta Tag in HTML and its Attributes.

Q1. What is <meta> tag in HTML?
Or Why do we use Meta tag in HTML? Explain any two attributes of meta tag ?

Ans. Metadata is data (information) about data. The <meta> tag provides metadata about HTML document. Metadata will not be displayed on the page, but will be machine parsable. These elements are typically used to specify page description, keywords, author of the document, modified and other metadata.
The metadata can be used by browsers, search engines or other web services.
Syntax:
<html>
<head>
<title>......</title>
<meta>
</head>
</html>

1. Attributes of Meta Tag in HTML:

A meta tag can have following attributes :
Attribute : Name
Description: Name for the property.

Attribute : Content
Description: Specifies the property's value.

Attribute : Scheme
Description: It specifies a scheme to interpret the property value.

2. For example 1 :

<html>
<head>
<title> Meta Tags Example </title>
<meta name = "keywords" content = "HTML, Metadata"/>
<meta name = "description" content = "learning Tags"/>
<meta name = "revised" content = "Discussion Point"/>
<meta http-equiv="refresh" content= "2; url = http://google.com" />
</head>
<body>
<p> Meta Tags </p>
</body>
</html>

3. Meta Tag of HTML:

A meta tag is an HTML tag containing information or data for search engines about a specific website like Studywow .Meta tag is most important element for site optimization process(SEO). Many search engines specifically focus on a keyword that was in the title tag.

The meta tag are allowed to add information about your document. For example the author name(which is you), it could also help search engines such as google in searching your website by adding the keywords (that you want the user to type in the search engine to find your website) in the meta tag.

4. Notes about Meta Tag of HTML:

Note1 :<meta> tags always go inside the <head> element.
Note2 : Metadata is always passed as name/value pairs.
Note3 : The content attribute MUST be defined if the name or the http-equiv attribute is defined. If none of these are defined, the content attribute CANNOT be defined.

5. Example 2 :

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="Study Material">
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
<meta name="author" content="Mayank Rana">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<p>All meta information goes in the head section...</p>

</body>
</html>




Join us on Facebook and Twitter  to get the latest study material. You can also ask us any questions.
Facebook = @ studywow
(click on it or search "studywow" on facebook)
Twitter = @ studywow
(click on it or search "studywow" on Twitter)
Email= studywow.com@gmail.com
Send us your query anytime!