HTML and CSS Reference
In-Depth Information
2. Type the following lines of code in your document. Press the Enter key after each
line. Press the Enter key twice for a blank line between lines of code. See Figure 1-3.
Make sure you include
the exclamation point (!)
within the doctype; oth-
erwise, browsers will not
recognize the doctype.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
Figure 1-3
Basic structure of an HTML fi le
doc type for HTML5
documents
doctype indicates the
type of doc ument
head section contains
information about the
document
opening html tag
body section contains
content to be displayed
by Web browsers
closing html tag
3. Save the file as jprop.htm in the tutorial.01\tutorial folder included with your
Data Files.
Trouble? If you are using the Windows Notepad text editor to create your HTML
file, make sure you don't save the file with the extension .txt , which is the default
file extension for Notepad. Instead, save the file with the file extension .htm or
.html . Using the incorrect file extension might make the file unreadable to Web
browsers, which require file extensions of .htm or .html .
To make it easier to link
to your Web pages, follow
the Internet convention
of naming HTML files
and folders using only
lowercase letters with no
spaces.
Now that you've entered the basic structure of your HTML fi le, you can start entering
the content of the head element.
Marking the Head Element
In general, the head element is where you provide browsers with information about your
document. This can include the page's title, the location of any style sheets used with the
document, the location of any programs that browsers should run when they load the
page, and information for use by search engines to aid users in locating the Web site.
Defi ning the Page Title
The fi rst element you'll add to the head of Dave's document is the title element, which
has the syntax
<title> document title </title>
where document title is the text of the document title. The document title is not dis-
played within the page, but is usually displayed in a browser's title bar or on a browser
Search WWH ::




Custom Search