Open In App

HTML | <meta> charset Attribute

The HTML charset Attribute is used to specify the character encoding for the HTML document. The charset attribute could be overridden by using the lang attribute of any element.

Syntax:



<meta charset="character_set">

Attribute Values: It contains the value i.e character_set which specify the character encoding for the HTML document.
Values:

Example: This Example illustrates the use of charset Attribute in Meta Element.




<!DOCTYPE html>
<html>
  
<head>
    <title>
      HTML charset Attribute
  </title>
    <meta name="keywords" 
          charset="UTF-8"
          content="Meta Tags, Metadata" />
</head>
  
<body style="text-align:center">
    <H1>Hello GeeksforGeeks!</H1>
    <h2>
      HTML charset Attribute in Meta Element
  </h2>
</body>
  
</html>

Output:



Supported Browsers: The browser supported by HTML <meta> Charset Attribute are listed below:

Article Tags :