Chapter 5. Layout

Well-formedness and validity check basic syntactic constraints. The next step is to make sure the semantics are appropriate. Each element should be used for its intended purpose: ul for unordered lists, ol for numbered lists, table for tabular data, blockquote for quotations, h1h6 for headings, and so forth. Using the proper semantics for each element renders pages more intelligible to screen readers, and makes sure they can be displayed properly on different platforms. As you’ll see, proper semantics have a number of other beneficial characteristics as well.

Many good semantic elements, such as ul, blockquote, and table, have been abused to achieve particular layout effects. The goal of this abuse is to produce a very particular ...

Get Refactoring HTML: Improving the Design of Existing Web Applications 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.