Font Style in XHTML MP

You can use tags to change the font style of the text in XHTML MP. However, some WAP browsers only support a subset of these tags, even though these tags are defined by the XHTML MP specification. This is because the WAP browser can only make use of the fonts available on the mobile device. For example, if the italic font is not available, the italic style is not supported. Unsupported XHTML MP tags will be ignored by WAP browsers and will not cause any errors.



<?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>Font Style</title>
  </head>

  <body>
    <p>
      <b>Bold</b><br/>
      <i>Italic</i><br/>
      <b><i>Bold italic</i></b><br/>
      <small>Small</small><br/>
      <big>Big</big><br/>
      <em>Emphasis</em><br/>
      <strong>Strong</strong>
    </p>
  </body>
</html>




The <b> and <i> tags means bold and italic respectively. The <small> tag reduces the text size. The <big> tag increases the text size. The <em> and <strong> styles are similar. The WAP browser will display text with emphasis (<em>) or strong (<strong>) style in some way that makes it more noticeable. The effect depends on the actual wireless device.


The following screenshots show the output of the above XHTML MP markup code in some WAP browsers. The result will be somewhat different on other mobile phone models.












Sony Ericsson T610



Nokia Mobile Browser 4.0




You can have more precise control over font formats with WAP CSS. For example, you can control the font family to be used or set a specific font size (e.g. 12pt) to some text.


The <u> tag of HTML does not exist in XHTML MP. So, if you want to underline some text, WAP CSS has to be used.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.