A SHORT NOTE ON <meta> TAG AND HIS ATTRIBUTES
Before you start coding with HTML, these are a few things you should know
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
Metadata
of 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....!
name
:- This attribute is document level metadata of whole page.http-equiv
:- It is similarly namedHTTP
header, means equivalent toHTTP
headers.charset
:- This is a charset declaration which gives character encoding in which whole document encoded, best example isUTF-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
..!
application-name
: Name of the application which is running on the web page.author
: Simple name of the document author.description
: Short, Sweet, Accurate summary of the content of the page. Used as default description of bookmarked pages.generator
: This is the identifier of the software that generated the page.keywords
: Words relevant to the page's content separated by commas.referrer
: Controls theHTTP
Referer
.☞theme-color
: Indicates a suggested color that user agents should to customize the display of the page or of surrounding user inrterface.color-scheme
: It specifies one or more color schemes with which the document is compatible. Some property of thecolor-scheme
arenormal
,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.