DOCTYPEs
The first tag in our Hello World example is the DOCTYPE tag, which stands for the Document Type Declaration. The DOCTYPE declaration does a couple of things, but the most important is that it tells the browser how to render the page. In this case, we used <!DOCTYPE html> since we will be using HTML 5 in later sections. Other DOCTYPES include:
HTML 4.01 Strict:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
XHTML 1.0 Strict:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
XHTML 1.1 Basic:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> |
Just to name a few. For even more DOCTYPEs, a simple web search will yield most of the supported Document Type Declarations.
The HEAD Tag
The <head> tag is a container for elements that won't display on web pages, but contain useful information. The <head> tag is only valid within the HTML Element ("<html>").
Within the HEAD element, we can specify the title of the web page. In our Hello World example, we set the title to "Hello World!" using the line:
<title>Hello World!</title> |
The TITLE element is only valid within the HEAD element. There is other valuable information we can put inside the HEAD tag, which we will learn in later sections.
0 comments:
Post a Comment