4 - HTML Web Apps

Created Friday 06 February 2015

Character Encoding

The charset attribute specifies the character encoding for the HTML document. Since our content is going to be in UTF-8 we will define the charset as UTF-8. UTF-8 can also handles ASCII. And hence the mixed content of UTF-8 and ASCII in the document renders well when the charset is defined as UTF-8. Below I have example code to define the charset and also the screenshots of broswer displaying the same content with charset not defined and defined as UTF-8.

<head>
<meta charset="UTF-8">
</head>

Or you can use the old way

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Ordered Lists

Support for Indic based order lists are very browser specific. But most modern browsers support it. Its done using list-style-type CSS attribute. For example setting list-style-type to kannada will produce list numbering as described in the CSS3 Lists module and displays Kannada numerals. Quite a few Indian languages like Kannada, Telugu, Tamil, Malayalm, Devnagari, Bengali etc are supported. Below I have demo code and rendering of the same in browser

<ol style="list-style-type:kannada">
<li>First</li>
<li>Second</li>
<li>Third</li>
</ol>
<ol style="list-style-type:devanagari">
<li>First</li>
<li>Second</li>
<li>Third</li>
</ol>
<ol style="list-style-type:hindi">
<li>First</li>
<li>Second</li>
<li>Third</li>
</ol>