HTML and CSS Reference
In-Depth Information
The <li> tag can contain any amount of text, from a single word to multiple sentences.
Because <li> tags are considered block elements, they are to be used in place of
<p> tags and not combined with them. In other words, it is wrong to write code
like this:
<li><p>Listed paragraphs are not pretty.</p></li>
You can devote all the items in a <ul> tag to be a series of links. In fact, this technique is how most
menu navigation is coded by web standards-compliant designers. For example, the HTML for a
simple navigation bar might be coded like this:
<ul>
<li><a href=”about.html”>About</a></li>
<li><a href=”services.html”>Services</a></li>
<li><a href=”portfolio.html”>Portfolio</a></li>
<li><a href=”contact.html”>Contact</a></li>
</ul>
Through a robust application of CSS rules, this humble bulleted list can be rendered as a horizontal
navigation bar, complete with background images (the open half circle) that change appearance with
user interaction as shown in Figure 13-2.
FiGure 13-2
Try iT
In this Try It you learn how to insert an unordered list into an HTML page.
Search WWH ::




Custom Search