2.5 Content Model Categories

What Content Is Allowed Within a Particular Container?

Despite the HTML validation service’s shortcomings mentioned in the previous section, it’s still a helpful tool, and you should use it. It’s good at identifying syntax errors, like misspelling tag names. It’s also good at containership rules. For example, the head container must contain a title element, and a p container must not contain a div container. With lots of elements (around 115), there are lots of containership rules (more than 11,000).1 Rather than having you remember each of those rules, it’s easier to assign elements to certain categories and have those categories be the basis for the containership rules. For a given web page, if an element ...

Get Web Programming with HTML5, CSS, and JavaScript 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.