HTML and CSS Reference
HTML 4, XHTML, and HTML5
Which HTML specification (or draft specification) you choose to write
markup based on is entirely up to you (or your supervisors or clients).
Though HTML5 may offer some exciting new features such as additional
structural elements and web form components, they all are “standards”
and work equally well with CSS.
It is important, however, that you do pick and write to both the DOCTYPE
and codification of the standards and the semantic rules of the specifica-
tion. Though there are rules for handling markup errors in some specifi-
cations, invalid markup such as improperly nested elements or tags that
are never closed can often lead to unexpected styling consequences. In
a similar vein, poor markup semantics may muddy up your selectors and
make your CSS code difficult to follow.
The most common piece of software that consumes and renders the
display of web pages and CSS is the web browser.
The term for the broad category of anything that can consume a web
document is a user agent . User agents include the typical web browser
but also tools such as screen-reading applications, feed readers, Google
and other search engine spiders, and other programmatic interfaces.
Devices are the hardware the user agents run on and often dictate what
features that user agent can support. A smartphone may have a smaller
screen than a desktop computer, a printer takes on the characteristics of
a printed page, and a Wii may display content on a standard-definition
User agents on devices such as desktop browsers where the content is
displayed on one large canvas (or viewport) are classified as continuous