HTML content type

From Petr Sladek

Jump to: navigation, search

How to set meta http-equiv with a content-type in HTML.

If your web page displays incorrect characters, the problem may be incorrect character encoding in your HTML document. If you want to change the character encoding in a HTML document use the meta tag with the http-equiv attribute, this specifies the content type and character encoding for the document.

Example if you want to specify the UTF-8 character encoding in your HTML document:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

There is also an easier way to write this, thought this might not be supported in older browsers:

<meta charset="UTF-8">
Personal tools