Hello, World! This page is encoded in UTF-8.
``` --- ## Browser Support The `charset` attribute is universally supported by all modern web browsers: * Google Chrome * Mozilla Firefox * Microsoft Edge / Internet Explorer * Safari * Opera --- ## Definition and Usage The `charset` attribute tells the browser how the bytes in the HTML file should be converted into readable characters on the screen. ### Key Points: * **Default Standard:** `UTF-8` is the recommended character encoding for all modern web pages. It covers almost all characters and symbols in the world. * **Language Override:** While `charset` defines the character encoding, the `lang` attribute on the `` tag (or other elements) can be used to specify the language of the text, which helps search engines and screen readers. --- ## HTML 4.01 vs. HTML5 Differences In **HTML 4.01**, declaring the character set required a longer, more complex `http-equiv` statement: ```html ``` In **HTML5**, this was simplified to the much cleaner `charset` attribute: ```html ``` *Note: While the older `http-equiv` syntax is still supported by browsers for backward compatibility, the HTML5 syntax is highly recommended as it reduces code size and is easier to read.* --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | *character_set* | Specifies the character encoding for the HTML document.**Commonly used values:**
β’ `UTF-8` - Character encoding for Unicode (Recommended).
β’ `ISO-8859-1` - Character encoding for the Latin alphabet.
In theory, you can use any character encoding, but not all browsers support obscure sets. The more widely used an encoding is, the better browser compatibility it will have. | For a complete list of registered character sets, you can visit the official (http://www.iana.org/assignments/character-sets). --- ## Best Practices and Considerations 1. **Place it Early:** Always place the `` tag as the very first element inside the `` section. It should appear before any tags that contain text, such as `
YouTip