9. Comments in XHTML MP

Comments are placed inside <!-- --> in XHTML MP. This is the same as HTML and WML 1.x. For example, the following lines are comments. WAP browsers ignore all comments.


<!-- This is a comment in XHTML MP -->

<!-- This is a multi-line
     comment -->


10. Line Breaking in XHTML MP

<br/> is the line breaking tag in XHTML MP, which is the same as that in HTML and WML 1.x. The following example demonstrates the usage of line breaks:


(lineBrEg1.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>Line Break</title>
  </head>

  <body>
    <p>
      Line 1<br/>
      Line 2<br/><br/>
      Line 3
    </p>
  </body>
</html>


The result should look like this in WAP browsers:


Sony Ericsson T610


Nokia Mobile Browser 4.0


11. XHTML MP Horizontal Rules

The <hr/> tag is used to add a horizontal rule to your XHTML MP page. Note that <hr/> should not be enclosed in the <p></p> tag pair.

The following example demonstrates the usage of horizontal rules in XHTML MP:


(hrEg1.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:<br/>
    </p>
    <hr/>
    <p>
      Part 1 XHTML MP Introduction<br/>
      Part 2 Development of Wireless Markup Languages<br/>
      Part 3 Advantages of XHTML MP<br/>
      Part 4 WML Features Lost in XHTML MP
    </p>
  </body>
</html>


The following screenshots show the result of the above XHTML MP example in some mobile phone browsers:


Sony Ericsson T610


Nokia Mobile Browser 4.0


Previous Page Page 15 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