Learning Hypertext Markup Language (HTML) and Extensible Hypertext Markup Language (XHTML) is like learning any new language, computer or human. Most students first immerse themselves in examples. Studying others is a natural way to learn, making learning easy and fun. Our advice to anyone wanting to learn HTML and XHTML 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' documents 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 all 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 language syntax correct or it won't work. Then, too, there is the problem of "standards." Committees of academics and industry experts define the proper syntax and usage of a computer language like HTML. The problem is that browser manufacturers like Netscape Communications Corporation (now an America Online company) and Microsoft Corporation choose the 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.
Standards change, too. As we write this current edition, HTML is undergoing a conversion into XHTML, making it an application of the Extensible Markup Language (XML). HTML and XHTML are so similar that we often refer to them as a single language. But there are key differences; more about this later in the preface.
To be safe, the way to become fluent in HTML and XHTML is through a comprehensive, up-to-date language reference that covers the language syntax, semantics, and variations in detail to help you distinguish between good and bad usage.
There's one more step leading to fluency in a language. To become a true master of the language, 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 and XHTML, fully versed in their syntax, semantics, and elements of style. We take the natural learning approach, using examples: good ones, of course. We cover every element of the currently accepted versions (HTML 4.01 and XHTML 1.0) of the languages in detail, as well as all of the current extensions supported by the popular 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 will give you suggestions for style and composition to help you decide how best to use HTML and XHTML to 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 and XHTML, starting with basic syntax and semantics, and finishing with broad style guidelines to help you create beautiful, informative, accessible documents that you'll be proud to deliver to your browsers.
0.1. Our Audience
We wrote this book for anyone interested in learning and using the language of the Web, from the most casual user to the full-time design professional. We don't expect you to have any experience in HTML or XHTML 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 very surprised if you haven't at least experimented with this technology by now. 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 web browsers -- preferably Netscape Navigator and Internet Explorer. Because HTML and XHTML documents are stored in a universally accepted format -- ASCII text -- and because the languages are 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 or XHTML documents can look quite different depending on the computer and version of browser. We will explain how the various browsers use certain language features, 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, XHTML, 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 with HTML or XHTML specifically, or if you are interested in the new features in the latest standard version of HTML and XHTML, start by reading Chapter 2, "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 and XHTML. Read them in order for a complete tour through the language, or jump around to find the exact feature you're interested in.
Copyright © 2002 O'Reilly & Associates. All rights reserved.