Skip to main content

The Character Set! Meta tag!

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. 

Metadata* is data (information) about data.
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>
<meta charset = "UTF-8">
 <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

Popular posts from this blog

Is Food Security Bill really secure?

#FSB  : For the last couple of days there has been a debate on whether the Food Security Bill* is the optimum package provided to the poor and needy ones of india or is this just another gimmick by Congress to win hearts at the time of elections . So i decided to study the bill clearly and I realized that it may have some good points but this is not the last nail in the coffin. Here is what I observed in the Bill to be passed in the Parliament yet : 1) According to the bill the earlier food security plan for the BPL ( below poverty line ) residents of the country which says that 35 kg of grain is to be provided to the poor on t he basis of their ration card per family . The new FSB as presented by Congress says that now they will allocate the supply not per family but 5 kg per head . So that means a family of three getting 35 kg a month will get 15 kg grain . Is this a Food Security Bill or a Food Scarcity Bill ? 2) In every state the current pla n provides sugar , cer...

How to program pyramids using loops

While programming, beginners do come up with some form of pyramid to be printed using any kind of loops in most programming languages. This video presentation clarifies the basic concept behind coding these pyramids in any programming language and explains how these loops can be created and manipulated to obtain different outputs. If you visualize properly, these pyramids are mere TABLES, combination of rows and columns. Having said that, we can understand that there needs to be a logic to control both rows and columns of the table and do that in such a way that the desired pattern is obtained. For doing so, we use two loops in case of a simple pyramid , one for the rows and other for the columns. Since, the general convention is to represent the rows prior to columns , assuming the same, the outer loop tracks the rows and the inner loop tracks the columns. The outer loop is fairly simple and is defined starting from 0 or 1 depending on your preference in most of the cases ...

How to program pyramids using loops - 2

In this video tutorial, two of the more patterns have been discussed that relates to the similar pattern problems. What's different about these are that they also include spaces before the stars as a part of the pattern to be printed. Having this extra sub pattern to track spaces  in the desired pattern requires an extra loop to track and control it . For a brief review, We discussed that these patterns if observed carefully are just representation of tables i.e. a combination of rows and columns . And few of the cells in that table are populated with some data according to a logically programmed algorithm with represents a pattern. In these cases, the red triangles shows us the spaces represented by "sp" and therefore unlike the previous pattern these need to be managed by the loop as they occur before the stars in the pattern. So, taking the same approach of rows and columns managing loops, we will have an outer loop that tracks the rows which will start at 0...