HTML and CSS Reference
Why is the XHTML code in the Hands-On Practice examples indented?
It doesn't matter to the browser if XHTML code is indented, but humans find it easier to read
and maintain code when it is logically indented. Review the definition list created in Hands-On
Practice 2.6. Notice how each tag level ( <dl> , <dt> , and <dd> ) is indented two spaces. This
makes it easier for you or another Web developer to understand the source code in the future.
There is no “rule” as to how many spaces to indent, although your instructor or the organiza-
tion you work for may have a standard. Consistent indentation helps to create more easily
maintainable Web pages.
The XHTML code to create the ordered list shown in Figure 2.11 follows:
<h1>Popular Web Servers</h1>
<li>Apache Web Server</li>
<li>Sun Java System Web Server</li>
Unordered lists show a bullet before each entry in the list. This bullet can be one of sev-
eral types: disc (the default), square, and circle. See Figure 2.12 for a sample unordered
Unordered lists begin with an <ul> tag and end with an </ul> tag. Each list item
begins with an <li> tag and ends with an </li> tag. The type attribute can be used to
change the type of bullet. For example, to create an unordered list organized with
square bullets, use <ul type="square"> . Table 2.3 documents the type attribute and
its values for unordered lists.
Table 2.3 type attributes for unordered lists
disc (the default)