15. XHTML MP Lists

The <ul>, <ol> and <li> elements are used to create lists in XHTML MP.

To create an unordered list, use the <ul> element. Each list item in an unordered list begins with a bullet. The <li></li> tags are used to enclose every list item. This XHTML MP example demonstrates how to create an unordered list:


(listsEg1.xhtml)

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ul>
      <li>Part 1 XHTML MP Introduction</li>
      <li>Part 2 Development of Wireless Markup Languages</li>
      <li>Part 3 Advantages of XHTML MP</li>
      <li>Part 4 WML Features Lost in XHTML MP</li>
    </ul>
  </body>
</html>






Sony Ericsson T610





Nokia Mobile Browser 4.0


To create an ordered list, use the <ol> element. An ordered list has list numbering. List items are enclosed within <li></li> tags. The following XHTML MP example demonstrates how to create an ordered list.


(listsEg2.xhtml)

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ol>
      <li>XHTML MP Introduction</li>
      <li>Development of Wireless Markup Languages</li>
      <li>Advantages of XHTML MP</li>
      <li>WML Features Lost in XHTML MP</li>
    </ol>
  </body>
</html>






Sony Ericsson T610





Nokia Mobile Browser 4.0


You can make use of the start attribute of the <ol> element to specify the starting number of the sequence, like this:


(listsEg3.xhtml)

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ol start="4">
      <li>XHTML MP Introduction</li>
      <li>Development of Wireless Markup Languages</li>
      <li>Advantages of XHTML MP</li>
      <li>WML Features Lost in XHTML MP</li>
    </ol>
  </body>
</html>


The result of the above XHTML MP example in some WAP browsers is shown below:





Sony Ericsson T610





Nokia Mobile Browser 4.0


With WAP CSS, you can have more precise control over the outlook of a list. For example, you can control the bullet shape of unordered lists and the list numbering of ordered lists (for example, changing the list numbering from "1, 2, 3..." to "i, ii, iii...").

Some of the commonly used list properties of WAP CSS are discussed in the "WCSS List Properties" section of our WAP CSS tutorial.


Previous Page Page 19 of 36 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page