2.1. Understanding Document-Level Tags

Web documents are made up of several nested layers, and each layer is typically delimited by a particular HTML tag. Most Web veterans know that HTML documents start and end with <html> tags. However, those new to HTML or those who haven't kept up with the HTML standards might not realize that the document should start with a doctype tag and that the top layer doesn't have to be <html> (although it usually is).

The tags that make up the framework of a typical HTML document include the following:

  • A document type tag

  • The top-level tag, generally <html>

  • A header section, delimited by <head> tags

  • Title, style, and script information enclosed in the <head> section

The following sections detail the various tags and sections in a typical Web document.

Web document is used in this book to refer to HTML documents due to the Web becoming closer to a true publishing platform.

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP 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.