In XHTML MP, leading and trailing whitespaces of a paragraph is not displayed. Furthermore, two or more whitespaces in a paragraph are shown as one whitespace on the screen of mobile devices. This behavior is demonstrated in the following XHTML MP example.
<?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> Hello, welcome
to
our
XHTML MP tutorial. </p>
</body>
</html>
|
|
To preserve the formatting of the text in XHTML MP, you have to use the <pre> element, like this example:
<?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>
<pre> Hello, welcome
to
our
XHTML MP tutorial. </pre>
</body>
</html>
|
|