Pages

Wednesday, January 12, 2011

List Item Element

The list item element is used to create an item for unordered and ordered list. The list item element can contain text or other elements. The list item element can even add more unordered and ordered list inside it.

Listed below are the most common attributes you can use for the list item element:
  • class - provides the class or classes of the heading. This attribute is used to identify the name of the style class or classes to be used for rendering.
  • id - provides a unique name for the heading.
  • lang - provides the language in which the enclosed content is coded.
  • style - provides a cascading style sheet (CSS) properties to the heading.
  • title - privides a text title for the heading. Most web browser displays the value of the title as "tooltip".


Here's an example on how to use the list item <li> element:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
         <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
         <mate name="keywords" content="blog, web development" />
         <title>the LIST ITEM element</title>
     </head>

     <body>
       <h1>
         the LIST ITEM element
       </h1>
       <ul>
            <li>1 small onion, sliced</li>
            <li>8 cloves garlic, peeled</li>
            <li>1 1/2 cups water</li>
            <li>1 tsp. salt</li>
            <li>2 Tbsp. tomato paste</li>
            <li>1 medium mango, sliced</li>
       </ul>
   </body>
</html>

0 comments:

Post a Comment