Open In App

HTML | <meta> charset Attribute

Improve
Improve
Like Article
Like
Save
Share
Report

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:

  • UTF-8: It specify the character encoding for Unicode.
  • ISO-8859-1: It specify the character encoding for the Latin alphabet.

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:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Last Updated : 29 Jan, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads