Preface

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 Web with a suitable browser and see for yourself what looks good, what’s effective, and 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 helps 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.

Computer-based languages are more explicit than human languages, though the markup languages are much more forgiving than the programming ones. Nonetheless, you typically have to get the computer language syntax correct or it won’t work. There are “standards,” too. Committees of academics and industry experts define the proper syntax and usage of a computer language like HTML. The problem is that the browser technologies that you and your audience use to display your documents don’t always keep up with the standards. Some can’t, like the limited viewers used in the burgeoning mobile-device market. And then there are those that make up their own parts to the language; standards be damned.

Standards change, besides. 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, which we discuss later in this 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 also what is effective. Layout matters. 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 in detail every element of the currently accepted standard versions of the languages (HTML 4.01 and XHTML 1.0) as well as all of the current extensions supported by the popular browsers, explaining how each element works and how it interacts with all of 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 HTML and XHTML to accomplish a variety of tasks, from simple online documentation to complex marketing and sales presentations. We 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 definitive 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 readers.

Get HTML & XHTML: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.