JavaScript EditorDebugger script     Dhtml css 



Team LiB
Previous Section Next Section

Creating a Bulleted List

The UL (Unordered List) and LI (List Item) elements are used together to create a list of bulleted items. Add a bulleted list to the example page (see Figure 2.7):

<h2>Personal Information</h2>
<p>Here is some more information about me:</p>
<ul>
<li>I have red hair and green eyes.
<li>I <i>like</i> science and math.
<li>I'm taller than my boyfriend.
<li>I live to skate!
<li>When not studying or skating, I like to go to the movies.
</ul>
Click To expand
Figure 2.7: A bulleted (or unordered) list is created using the UL and LI elements.

The UL element brackets the list and specifies that the list will be an unordered (or bulleted) list, whereas the LI elements are nested inside of the UL element, defining the separate items that are included in the list. Notice also that the LI elements do not have end tags. That might cause you to think that the LI element is an empty (or standalone) element, but you would be wrong. The LI element is a container element, but with an implied end tag. You are free to add the end tag, if you want, but it is pretty conventional to leave it out. Including or leaving out the end tag makes no difference in how the list will be displayed.


Team LiB
Previous Section Next Section


JavaScript EditorDebugger script     Dhtml css