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

How to open any installed application on MAC OS X using Terminal !

MAC OS X 10.9 is one of the finest operating systems used in the business as well as household purposes. Considering the unix side of the operating system, it becomes beneficial to be able to do trivial stuff like opening any app directly from the command line interface, i.e. Terminal in this case. There are a lot of other uses that a utility like terminal can offer you but for the instant purpose, let us find out how to open any of the installed applications on your MACINTOSH using the terminal. I will be working with few of the application I have installed on my system. You are free to choose your own. The general syntax for the command is : open -a application_name If you want to open the application as a super user, just prefix the command with sudo : sudo open -a application_name Test commands : (Use these commands one-by-one to open the specified applications) open -a textmate open -a bbedit open -a firefox open -a opera open -a finder open -a mail Watc...

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...

Turn your Linux into a wifi hotspot for Android and Windows phones! (Ubuntu and Linux Mint)

This is one of the biggest problem linux users face i.e. to share your ethernet connection over wifi for your android or windows mobile device. Here is a simple step process to easily set up a hotspot on your laptop to connect your mobile devices to surf on the go! 1. We need to install 2 additional tools to make our hotspot work: hostapd(hotspot server)   dnsmasq(dns dhcp server) Open the terminal (Ctrl+alt+T) and type:  sudo apt-get install hostapd dnsmasq and press enter. Wait for them to install.   2. Stop these services and prevent them from starting on system start up. To do that; open a terminal and type each command per line and press enter: sudo service hostapd stop sudo service dnsmasq stop sudo update-rc.d hostapd disable sudo update-rc.d dnsmasq disable   3. Now we need to set the configuration files for both the installed tools. To open the config file of dnsmasq ; open a terminal (Ctrl+alt+T) and type sudo gedit /etc/dnsmasq.con...