HTML and CSS Reference
In-Depth Information
<!doctype html>
This tag informs the web browser to render the page in standards mode. According to
the HTML5 spec from W3C, this is required for HTML5 documents. This tag simplifies
a long history of oddities when it came to rendering HTML in different browsers. This
should always be the first line of HTML in a document.
<html lang="en">
This is the
<html>
tag with the language referenced: for example,
“en”
= English. Some
of the more common language values are:
Chinese -
lang = “zh”
French -
lang = “fr”
German -
lang = “de”
Italian -
lang = “it”
Japanese -
lang = “ja”
Korean -
lang = “ko”
Polish -
lang = “pl”
Russian -
lang = “ru”
Spanish (Castilian) -
lang = “es”
<meta charset="UTF-8">
This tag tells the web browser which character-encoding method to use for the page.
Unless you know what you're doing, there is no need to change it. This is a required
element for HTML5 pages.
<title>…</title>
This is the title that will be displayed in the browser window for the HTML page. This
is a very important tag, as it is one of the main pieces of information a search engine
uses to catalog the content on the HTML page.
A Simple HTML5 Page
Now let's look at this page in a web browser (this would be a great time to get your
tools together to start developing code). Open your chosen text editor, and get ready
to use your preferred web browser: Safari, Firefox, Opera, Chrome, or IE.
1. In your text editor, type in the code from
Example 1-1
.
2. Save the code as
CH1EX1.html
in a directory of your choosing.