Review – HTML and XHTML, The Definitive Guide

Share this article

Do you want to learn HTML?

If the answer is yes, this book is it. If you have always thought that learning HTML would be an overwhelming experience, give this book a chance. Sure, HTML is a large and complex language, but anyone can learn it. It isn’t nearly as hard to learn as the English language, and you learned that one okay, didn’t you?

Oh, and if you already think you know HTML, but want to brush up or have a reference book to go back to — this book can be of great assistance to you as well.

What’s the difference between HTML and XHTML?

Firstly, HTML stands for Hypertext Markup Language and XHTML stands for Extensible Hypertext Markup Language. By learning HTML, you’ll learn most of XHTML.

XHTML is a strict version of HTML. The W3C (World Wide Web Consortium, which is the governing body on all of this, so to speak) has, as far as they are concerned, released their final iteration of HTML in version 4.01, and are now focused on the development of XHTML.

Many of the HTML tags you have come to know, and maybe even love, do not exist in XHTML. These include many of the presentation tags, such as font tags, because XHTML basically demands the use of Cascading Style Sheets (CSS).

XHTML also requires, for example, that you close every single tag in your document, even the tags that you didn’t have to close in HTML, such as image tags. All tag names and attributes are case sensitive and must be written in the lowercase, where in HTML that didn’t matter.

These are just a few of the many differences between HTML and XHTML and I can’t give you all of them in this short review (for more information on this, consult Nick Wilson’s XHTML — An Introduction). However, this should give you an idea of why the authors have discussed HTML and XHTML in a single volume — and how valuable that is to the budding developer.

Jackpot!

This book tells you everything you could want to know about HTML/XHTML. It explains every tag in detail, including the tag’s function, attributes, how it works, its end tag, and its browser compatibility. Then it explains each of the tag attributes, and what they do, in great detail.

In addition to all the current HTML/XHTML tags, this document also serves as a history book/archive, including depreciated tags, and those that are no longer in use, just so you can have a complete grasp of the language.

It’s written in a very easy to understand way and I really did enjoy reading it. You can sit next to your computer, type the tags they’re talking about, and see it all happen right in front of you, if that’s how you like to learn. The book is also full of graphic examples that illustrate exactly what certain pieces of code produce.

After you’ve read the book, you’ll possess the knowledge necessary to successfully create and edit HTML documents.

Cascading Style Sheets

Even though the book constantly reminds you that it is an HTML book, it definitely provides some great information about Cascading Style Sheets (CSS), which, as we discussed before, are essential to the developer who wants to build standards-compliant, forwards-compatible sites.

For those who don’t know, style sheets are the tool you should use to control the overall look (background, colors, fonts, etc.) of your Web documents. XHTML basically requires that you use CSS in your documents. This book teaches you how to write your own style sheets and embed them into your HTML pages, giving you the ability to customize the look of documents to your liking.

This book could be considered an introduction to all the basic concepts of CSS. If you want to learn HTML and CSS, but only want to get (or can only afford) one book, this one’s a great choice!

The Chapter Contents

The book covers a range of subjects that I don’t have time to mention in this short review, however, for a better idea of its contents, let’s take a look at the book’s chapters:

  1. HTML, XHTML, and the World Wide Web

  2. Quick Start

  3. Anatomy of an HTML Document

  4. Text Basics

  5. Rules, Images, and Multimedia

  6. Links Webs

  7. Formatted Lists

  8. Cascading Style Sheets

  9. Forms

  10. Tables

  11. Frames

  12. Executable Content

  13. Dynamic Documents

  14. Netscape Layout Extensions

  15. XML

  16. XHTML

  17. Tips, Tricks, and Hacks
Appendices and Quick Reference

There are nearly 100 pages toward the end of this book dedicated to quick reference information. So even after you’ve completed the book, you’ll still want to keep it handy as a constant reference as you work on your Websites.

This portion of the book includes references for HTML grammar, HTML/XHTML tags, Cascading Style Sheet (CSS) properties, character entities, color names and attributes as well as many other references. A handy pull-out reference is also included at the back of the book.

Rating: 4.5/5

I’ll be recommending this book to anyone and everyone who tells me that they want to learn HTML/XHTML. It’s extremely informative and useful, with excellent explanations and great reference documents. The price of the book is also a huge plus at just US$27.97, which is great value. All ’round: this is a fantastic book.

Title: HTML and XHTML, The Definitive Guide, Fifth Edition

Authors: Chuck Musciano and Bill Kennedy

Publisher: O’Reilly

Buy it at Amazon.com for $27.97

Frequently Asked Questions about HTML and XHTML

What is the main difference between HTML and XHTML?

HTML (HyperText Markup Language) and XHTML (eXtensible HyperText Markup Language) are both markup languages used to create web pages. The main difference between them lies in their syntax and rules. HTML is more flexible and allows for some syntax errors, while XHTML is stricter and requires all tags to be properly closed, all attribute values to be quoted, and all tags to be nested correctly. XHTML is essentially a more precise version of HTML, designed to work with XML parsers.

Why would I choose XHTML over HTML?

XHTML has several advantages over HTML. It is more strict, which can lead to cleaner, more organized code. It is also more compatible with XML, which is used in more advanced web applications. XHTML documents can be easily read and understood by XML parsers, making them more versatile for web development.

Can I convert an HTML document to XHTML?

Yes, you can convert an HTML document to XHTML. This process involves ensuring all tags are properly closed, all attribute values are quoted, and all tags are nested correctly. It may also involve changing some HTML-specific tags to their XHTML equivalents.

What are some common mistakes when writing XHTML?

Some common mistakes when writing XHTML include not closing tags, not quoting attribute values, and incorrectly nesting tags. XHTML is stricter than HTML, so these mistakes can cause an XHTML document to fail validation.

What is the future of XHTML?

XHTML was designed to replace HTML, but this has not happened as quickly as expected. However, XHTML is still widely used and has influenced the development of HTML5, which incorporates many of the strict syntax rules of XHTML. The future of XHTML is likely to continue to evolve alongside HTML.

How does XHTML improve accessibility?

XHTML improves accessibility by enforcing a stricter syntax, which can lead to cleaner, more organized code. This can make it easier for assistive technologies, like screen readers, to interpret the content of a web page.

What tools can I use to validate my XHTML code?

There are several online tools available to validate XHTML code, such as the W3C Markup Validation Service. These tools can check your code for syntax errors and help ensure it meets the standards for XHTML.

Can I use JavaScript with XHTML?

Yes, you can use JavaScript with XHTML. However, because XHTML is XML-based, it requires a slightly different syntax for including JavaScript than HTML.

What is the role of CSS in XHTML?

CSS (Cascading Style Sheets) is used with XHTML to control the layout and appearance of web pages. CSS can be used to set colors, fonts, sizes, and other visual properties of XHTML elements.

How does XHTML handle errors compared to HTML?

XHTML is stricter than HTML in handling errors. In HTML, browsers often correct syntax errors automatically, but in XHTML, even a small syntax error can cause the entire page to fail to display. This encourages developers to write cleaner, more accurate code.

Patrick O'KeefePatrick O'Keefe
View Author

Patrick O’Keefe is an online community, product, and program leader, with more than 20 years of experience building safe, inclusive platforms and services that drive action, grow revenue, and increase retention. He previously contributed to various SitePoint books, served as a Mentor and Advisor on the SitePoint Forums, and co-hosted the SitePoint Podcast.

Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week