meta charset Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:meta

Description

The charset attribute specifies the character encoding for the HTML document which can be overridden using the lang attribute on any element.

Attribute Values

Value Description
character_set Specifies the character encoding for the HTML document.

Common values:

  • UTF-8 - Character encoding for Unicode
  • ISO-8859-1 - Character encoding for the Latin alphabet

The following code shows how to Specify the character encoding for the HTML document:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
</head><!--  ww  w .j  ava  2  s  . c  o  m-->

<body>
<h1>My Website</h1>
<p>Some text...</p>
</body>

</html>

Related Tutorials