HTML5: Head Meta Tags - Declare Language and Charset correctly
Question by Guest | 2014-05-31 at 17:09
At the moment, I am trying to migrate my website to HTML 5 and on this occasion I would like to rewrite my HTML in a way so that the HTML Validator isn't showing errors anymore.
Currently, the following meta tags in the head of my page are making some trouble:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Language" content="en" />
How is it possible to declare language and character encoding in an HTML5 head without causing validation errors?
Related Topics
PHP: Set UTF-8 Charset in HTTP Header
Question | 1 Answer
HTML5 Canvas: Beginner Tutorial Chapter 1 - Introduction and Basics
Tutorial | 0 Comments
How to resize Image before Upload in Browser
Tutorial | 13 Comments
jQuery: Send HTML5 Canvas to Server via Ajax
Tutorial | 0 Comments
Send HTML5 Canvas as Image to Server
Tutorial | 0 Comments
PHP: Sending an E-Mail
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
The language is stated directly in the <html>-tag, because the language refers to this element (exceptions are possible with additional language definitions on other elements in the body). The charset is declared with <meta charset="UTF-8"> in the head.
Here is a small example of the basic frame of an HTML 5 page:
Important: You should specify the charset directly at the beginning of the head before writing any other text so that the browser knows how to interpret the page. Additionally, you should tell the charset directly via the HTML Response Header, for example with writing the following line into your HTACCESS file: AddDefaultCharset UTF-8
2014-05-31 at 23:28