...
- ...
- ...
- ...
- ...
What is the purpose of the charset
attribute in the <meta>
element?
The charset attribute specifies the character encoding for the HTML document.
It ensures that the browser correctly interprets the text content of the page by declaring the character set used. In HTML5, the only valid encoding is UTF-8, which supports a wide range of characters from different languages. This attribute must be placed within the first 1024 bytes of the document to be effective.
<meta charset="utf-8">
...
...
...