Skip to Main Content
HTML & XHTML: The Definitive Guide, 6th Edition
book

HTML & XHTML: The Definitive Guide, 6th Edition

by Chuck Musciano, Bill Kennedy
October 2006
Intermediate to advanced content levelIntermediate to advanced
680 pages
21h 44m
English
O'Reilly Media, Inc.
Content preview from HTML & XHTML: The Definitive Guide, 6th Edition

A First HTML Document

It seems every programming language book ever written starts off with a simple example on how to display the message, "Hello, World!" Well, you won't see a "Hello, World!" example in this book. After all, this is a style guide for the new millennium. Instead, ours sends greetings to the World Wide Web:

<html>
<head>
<title>My first HTML document</title>
</head>
<body>
<h2>My first HTML document</h2>
Hello, <i>World Wide Web!</i>
 <!— No "Hello, World" for us —>
<p>
   Greetings from<br>
<a href="http://www.ora.com">O'Reilly</a>
<p>
Composed with care by:
<cite>(insert your name here)</cite>
<br>&copy;2000 and beyond
</body>
</html>

Go ahead: type in the example HTML source on a fresh word processing page and save it on your local disk as myfirst.html. Make sure you select to save it in plain text format; word processor-specific file formats like Microsoft Word's .doc files save hidden characters that can confuse the browser software and disrupt your HTML document's display.

After saving myfirst.html (or myfirst.htm, if you are using archaic DOS- or Windows 3.11-based file-naming conventions) onto disk, start up your browser and locate and open the file from the program's File menu. Your screen should look like Figure 2-1. Though look-and-feel elements such as menus and toolbars differ between browsers, the window's contents should be quite similar.

A very simple HTML document

Figure 2-1. A very ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CSS Master, 3rd Edition

CSS Master, 3rd Edition

Tiffany B Brown

Publisher Resources

ISBN: 0596527322Errata Page