Pro HTML5 and CSS3 Design Patterns

(avery) #1
C H A P T E R 2

(^)


HTML Design Patterns


This chapter explores HTML only as it relates to CSS. It contains design patterns that are essential for
styling a document with CSS. It explores HTML at a high level with an eye toward explaining how
elements can be put to use structurally and semantically. Each design pattern in this book is created
using structural and semantic elements combined with CSS. There are four major types of elements used
in design patterns: structural block, terminal block, multi-purpose block, and inline elements.
Understanding these types of elements is key to understanding the design patterns in this book and
essential to creating your own.

Chapter Outline



  • HTML Structure shows how HTML elements work together to create a document.

  • XHTML shows how to mark up a document with valid XHTML. It also points out
    why using valid XHTML makes styling with CSS more reliable.

  • DOCTYPE shows how to use document types to validate the way documents are
    coded, and it explores what document types work best for CSS and HTML.

  • Header Elements shows how to create metadata about a document and how to
    link a document to supporting documents and related documents.

  • Conditional Style Sheet shows how to load a style sheet to fix problems unique to
    Internet Explorer.

  • Structural Block Elements shows how to create structural meaning in a
    document.

  • Terminal Block Elements shows how certain blocks have semantic meaning
    because they contain content instead of other blocks.

  • Multi-purpose Block Elements shows how certain elements can be used for
    block structure and semantic meaning.

  • Inline Elements shows how styles can bring out the meaning of semantic
    markup.

  • Class and ID Attributes shows how CSS relies on class and id attributes to select
    elements. It also shows how the class attribute can add meaning to an element.

  • HTML Whitespace shows how to make whitespace work for you instead of
    against you.

Free download pdf