A SHORT NOTE ON <meta> TAG AND HIS ATTRIBUTES

Before you start coding with HTML, these are a few things you should know

A SHORT NOTE ON <meta> TAG AND HIS ATTRIBUTES

HTML is a language made up of elements, which can be applied to pieces of text to give them different meaning in a document. Structure a document into logical sections, and embed content such as images and videos into a page. This something brief about HTML.

The whole HTML document is divided into two parts called the <head> and the <body>.

The <body> tag of an HTML document contains its main content. For more info

The <head> tag of HTML document contains data that will not appear on the browser screen, but it plays an important role when the page is loaded. A document's <head>tag is responsible for containing metadata of that html document. All those metadata are covered in the <meta> tag.

First of all What is <meta>?

  • By using the <meta> tag, HTML elements represent metadata of that document.
  • The Metadataof a piece of data is the information about it that describes what it contains.
  • In HTML meta data are like content,language,discription,encoder,encode-language,http-equiv,charset,authour and etc.
  • In mean that a <meta> contain overall summery of that HTML document.

Maybe you've learned something about <meta> for more

Then what are the main attributes of this <meta> tag....!

  1. name:- This attribute is document level metadata of whole page.
  2. http-equiv:- It is similarly named HTTP header, means equivalent to HTTP headers.
  3. charset:- This is a charset declaration which gives character encoding in which whole document encoded, best example is UTF-8 in a <head> of the HTML document.

Some more attributes are also there in <meta> of HTML <head> you can also go with the document

Ok now lets know few things about the Metadata name and http-equiv http-equiv, then a standard example(don't expect output! I think why you know?)

What is refresh in http-equiv?

This refresh decides the number of seconds until page should be reload, when only content attribute contains a non negative integer.

What is content-type in http-equiv?

It declares the media type and character encoding of the document. The content attribute must have the value text/html; charset="UTF-8". This is almost equivalent to a <meta> element with the charset attribute specified, and carries the same restriction on placement within the document.

What is default-style in http-equiv?

This attribute by name a simple attribute. It sets the name of the default CSS stylesheet.

Then towards more about name

let's know

Some standard Metadata names..!

  1. application-name: Name of the application which is running on the web page.

  2. author: Simple name of the document author.

  3. description: Short, Sweet, Accurate summary of the content of the page. Used as default description of bookmarked pages.
  4. generator: This is the identifier of the software that generated the page.
  5. keywords: Words relevant to the page's content separated by commas.
  6. referrer: Controls the HTTP Referer.
  7. theme-color: Indicates a suggested color that user agents should to customize the display of the page or of surrounding user inrterface.
  8. color-scheme: It specifies one or more color schemes with which the document is compatible. Some property of the color-scheme are normal, light, dark, only-light.

This all are some standard names which came under metadata names, but there also some other! You can catch here

Look at example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- Don't expect output of this code LOL! -->
</body>
</html>

Okay, I hope this information was helpful to you! and Please share your thoughts on this article by leaving a comment.

Did you find this article valuable?

Support Prajwal V Naik by becoming a sponsor. Any amount is appreciated!