Adding the html Element

After the DOCTYPE declaration, you'll want to begin building your document from its root element. I use the term root purposely because all documents create a document tree, something that we'll be exploring at length. Understanding the tree created by HTML documents plays an important role in being able to effectively style those documents using CSS.

The html element is considered the root element of any HTML document. Remember, the declaration isn't an HTML element—it's SGML. So the first element to appear takes on the important root status.

Example 1-2 shows the html element, with its opening tag and closing tag.

Example 1-2. The root HTML element

<html></html>

Pretty basic, right? Well, in XHTML, we have to ...

Get Spring Into HTML and CSS 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.