HTML and CSS Reference
In-Depth Information
input is a void element that must be closed in XHTML (see Chapter 8 for more about forms and
checkboxes). The above example of XHTML is perfectly valid in HTML5 as well, so once again the choice
of minimizing Boolean attributes is yours.
Like tag names, attribute names aren't case-sensitive in HTML but must be lowercase in XHTML. Attribute
values are never case-sensitive; a good thing because some values might need to use capital letters.
An element's start tag can include several attributes, separated by spaces, and attributes must appear
only in a start tag (or a void element's lone tag). Some elements require specific attributes whereas others
are optional—it all depends on the individual element, and you'll be learning about all of them throughout
the rest of this topic, including which attributes each element may or must possess.
Figure 2-1 illustrates the components of an element.
Figure 2-1. The basic components of an HTML element
Content Models
HTML5 has a variety of rules and requirements about where and when certain elements can appear in a
document, and what types of content each element can and can't contain. To simplify these often-
confusing rules, elements in HTML5 are divided into a few broad categories, or content models , classifying
elements by their expected contents. For example, some elements are intended to contain lengthy
passages of text, whereas other elements typically contain only a few words. It's important to be aware of
this as you construct your documents, ensuring that you use the right element for the right content. The
basic content models in HTML5 are:
Flow content : This umbrella category actually includes almost every element. The model is
called “flow content” because these elements influence the flow of other content on the page, like
a stone influences the flow of a stream.
Phrasing content : This category is for elements that contain a few words, distinct from the other
words around them, such as a link or an emphasized word within a sentence. We'll cover most of
the phrase elements in Chapter 4.
Search WWH ::

Custom Search