HTML and CSS Reference
The Document Type Definition, or DOCTYPE, tells browsers and validators what
version of HTML the page is written in. Previous versions of HTML specified the ver-
sion number, such as the DOCTYPE for XHTML 1.0 Strict:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
With HTML5, the version is dropped from the DOCTYPE. This allows HTML5 to be
backward compatible in terms of syntax and hopefully makes the transition to HTML5
Let's say you have a site that is valid HTML 4.0, but you want to transition it to HTML5.
All you have to do to make this a valid HTML5 site is make this DOCTYPE change.
Additionally, all browsers recognize the shortened DOCTYPE and render in strict
There are some elements that have changed between HTML4 and
HTML5, so you will need to watch for elements that have been removed
or deprecated. For example, center might not technically validate as
The W3C Working Draft discussion on differences between HTML4 and HTML5
1.2 Specifying the Character Set
You need to define the character encoding of your web page.
In your document head , add a meta declaration for the character set:
<meta charset="UTF-8" />
The character encoding instructs browsers and validators what set of characters to use
when rendering web pages. If you do not declare the character set in your HTML,
browsers first try to determine the character set from your server's HTTP response
headers (specifically, the Content-Type header).