HTML The Definite Guide.pdf

(4541 KB) Pobierz
HTML: The Definitive Guide
Copyright © 1999 O'Reilly & Associates . All Rights Reserved.
281605380.015.png
Preface
Preface
Learning Hypertext Markup Language - most commonly known by its acronym, HTML - is like
learning any new language, computer or human. Most students first immerse themselves in examples.
Think how adept you'd become if Mom, Dad, your brothers and sisters all spoke fluent HTML.
Studying others is a natural way to learn, making learning easy and fun. Our advice to anyone wanting
to learn HTML is to get out there on the World Wide Web with a suitable browser and see for
yourself what looks good, what's effective, what works for you. Examine others' HTML source files
and ponder the possibilities. Mimicry is how many of the current webmasters have learned the
language.
Imitation can take you only so far, though. Examples can be both good and bad. Learning by example
will help you talk the talk, but not walk the walk. To become truly conversant, you must learn how to
use the language appropriately in many different situations. You could learn that by example, if you
live long enough.
Remember, too, that computer-based languages are more explicit than human languages. You've got
to get the HTML syntax correct, or it won't work. Then, too, there is the problem of "standards."
Committees of academics and industry experts try to define the proper syntax and usage of a computer
language like HTML. The problem is that HTML browser manufacturers like Netscape and Microsoft
choose what parts of the standard they will use and which parts they will ignore. They even make up
their own parts, which may eventually become standards.
To be safe, the better way to become fluent in HTML is through a comprehensive language reference:
a resource that covers the language syntax, semantics, and variations in detail, and helps you
distinguish between good and bad usage.
There's one more step leading to fluency in a language. To become a true master of HTML, you need
to develop your own style. That means knowing not only what is appropriate, but what is effective.
Layout matters. A lot. So does the order of presentation within a document, between documents, and
between document collections.
Our goal in writing this book is to help you become fluent in HTML, fully versed in the language's
281605380.001.png 281605380.002.png 281605380.003.png
syntax, semantics, and elements of style. We take the natural learning approach with examples: good
ones, of course. We cover every element of the currently accepted version (4.0) of the language in
detail, as well as all of the current "extensions" supported by the popular HTML browsers, explaining
how each element works and how it interacts with all the other elements.
And, with all due respect to Strunk and White, throughout the book we give you suggestions for style
and composition to help you decide how best to use the language and accomplish a variety of tasks,
from simple online documentation to complex marketing and sales presentations. We'll show you
what works and what doesn't; what makes sense to those who view your pages, and what might be
confusing.
In short, this book is a complete guide to creating documents using HTML, starting with basic syntax
and semantics, and finishing with broad style directions that should help you create beautiful,
informative, accessible documents that you'll be proud to deliver to your browsers.
Our Audience
We wrote this book for anyone interested in learning and using HTML, from the most casual user to
the full-time design professional. We don't expect you to have any experience in the language before
picking up this book. In fact, we don't even expect that you've ever browsed the World Wide Web,
although we'd be surprised if you haven't at least experimented with this technology. Being connected
to the Internet is not necessary to use this book, but if you're not connected, this book becomes like a
travel guide for the homebound.
The only things we ask you to have are a computer, a text editor that can create simple ASCII text
files, and copies of the latest leading World Wide Web browsers - Netscape Navigator and Internet
Explorer. Because HTML is stored in a universally accepted format - ASCII text - and because the
language is completely independent of any specific computer, we won't even make an assumption
about the kind of computer you're using. However, browsers do vary by platform and operating
system, which means that your HTML documents can and often do look quite different depending on
the computer and version of browser. We will explain how certain language features are used by
various popular browsers as we go through the book, paying particular attention to how they are
different.
If you are new to HTML, the World Wide Web, or hypertext documentation in general, you should
start by reading Chapter 1, HTML and the World Wide Web . In it, we describe how all the World
Wide Web technologies come together to create webs of interrelated documents.
If you are already familiar with the Web, but not HTML specifically, or if you are interested in the
new features in HTML, start by reading Chapter 2, HTML Quick Start . This chapter is a brief
overview of the most important features of the language and serves as a roadmap to how we approach
the language in the remainder of the book.
Subsequent chapters deal with specific language features in a roughly top-down approach to HTML.
Read them in order for a complete tour through the language, or jump around to find the exact feature
you're interested in.
Text Conventions
281605380.004.png 281605380.005.png 281605380.006.png 281605380.007.png
Text Conventions
Throughout the book, we use a constant-width typeface to highlight any literal element of the
HTML standard, tags, and attributes. We always use lowercase letters for HTML tags. (Although the
language standard is case-insensitive with regard to tag and attribute names, this isn't so for other
elements like source filenames, so be careful.) We use italic to indicate new concepts when they are
defined and for those elements you need to supply when creating your own documents, such as tag
attributes or user-defined strings.
We discuss elements of the language throughout the book, but you'll find each one covered in depth
(some might say nauseating detail) in a shorthand, quick-reference definition box that looks like the
following box.
<html>
Function:
Delimits a complete HTML document
Attributes:
VERSION
End tag:
</html>; may be omitted
Contains:
head_tag , body_tag
Used in:
HTML documents
The first line of the box contains the element name, followed by a brief description of its function.
Next, we list the various attributes, if any, of the element: those things that you may or must specify as
part of the element.
We use the following symbols to identify tags and attributes that are not in the HTML 4.0 standard
(the latest official version), but are additions to the language:
Netscape Navigator extension to the standard
Internet Explorer extension to the standard
281605380.008.png 281605380.009.png 281605380.010.png 281605380.011.png
Zgłoś jeśli naruszono regulamin