Now that we have a page setup, the final touch to the structure of the webpage is to make the browser aware of the character set* it should use to recognize the characters. Technically, the charset attribute is used to specify the character encoding of the html document. The new standard for the charset used most commonly is the "UTF-8" encoding. The unicode character set is a collection of all the characters represented in a unicode format and UTF-8 is the encodind that corresponds to it.
The encoding of the document is information about the document and such information is called the Meta Informaion and hence a "meta" element is used for the purpose.
The encoding of the document is information about the document and such information is called the Meta Informaion and hence a "meta" element is used for the purpose.
The <meta> tag provides metadata about the HTML document. Metadata will not be displayed on the page, but will be parsable or can be understood by the machine.
Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata.
The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services.
As discussed earlier the meta tag is a part of the head element and is encapsulated within it.
<meta> includes the charset attribute within it in this following pattern :
<meta charset="character_set" >
Where character_set can have a value:
- UTF-8 - Character encoding for Unicode
- ISO-8859-1 - Character encoding for the Latin alphabet
Test code: ( Use this code to use the utf-8 encoding for the document )
<html>
<head>
<head>
<title>
My page still has a title within head tag
</title>
</head>
<body>
I can see my text appearing in the main content area.
All the content in the webpage is mentioned in this tag
</body>
<html>
Note: Save the page with an extension html or htm. There will be no external change in the appearance of the webpage but it makes a difference for the parsing of the page.
Comments
Post a Comment