HTML5: Character encoding with charset

This entry is part 3 of 34 in the series HTML5

The first line in the head section is the charset declarations.  This tells the browser on the character set used to interpret the document.

<meta charset='UTF-8'>

In this case the document is an html document encoded in the charset specified.  The charset used here is UTF-8.

Using UTF-8 will allow the page to interprete all the different character sets such as German and Chinese in the world.

<!DOCTYPE html>
<html>
<head lang='en'>
    <meta charset='UTF-8'>
    <title></title>
</head>
<body>

</body>
</html>

 

 

 

HTML: Applying bold and italic formatting

This entry is part 3 of 34 in the series HTML

Applying bold and italic styles are two ways of making text stand out and attract attention.

For simple boldface and italics, use the <b> tag and the <i> tag.

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Bold & Italic</title>
</head>
<body>

<p>I have like to go to <b>Thailand</b> for fun.</p>
<p>And to have some <i>great times</i> there.</p>

</body>
</html>

Here I have used lang=’en’ to state that the page is using English language as its default language.

Here I have also used <meta charset=”UTF-8″> for character encoding.  This is recommended by W3C for use in HTML and XML.

UTF-8 has basically become the dominant character encoding for the World Wide Web.