2.8. PREFORMATTED TEXT
33
tag, where CONTENT is typically text and other markup with some restrictions
(e.g. it can not contain any block level elements, e.g. p, table, div, or h1.
elements).
Finally, the most general way to separate the content in a page is to use the
div element, which has the form:
where CONTENT can be any of the HTML elements that can appear in the
body, including p and div elements. The div tag is similar to the p tag except
that a div element can contain a wider variety of tags. The p element should
only be used for paragraphs containing text and images.
2.8
Preformatted text
Browsers, by default, will reformat any text that you provide so that it fits
the page nicely. Thus, if you type a paragraph as one long line, the browsers
will generally add appropriate line breaks. Sometimes however, one wants the
browser to respect the formatting and not to insert any line breaks or remove
any spaces or tabs. This effect is provided using the pre element which has the
form
Pre
Formatted
Content
The preformatted content inside the pre element typically contains images and
text.
2.9
Lists
HTML offers several different types of lists. We consider only two types here:
ul and ol The ul element is used for unnumbered lists and has the form:
Content
....
Content
Observe that the ul element must contain a sequence of li elements, and each
li element can contain any of the HTML elements that can appear in the body.
These lists are rendered with asterisks or bullets or some other non alphanumeric