<html> is the root element of XHTML MP. All other elements should be enclosed within the <html></html> tags.
The xmlns attribute is used to define the namespace for XHTML MP. Currently only the value "http://www.w3.org/1999/xhtml" can be assigned to the xmlns attribute. You must include the xmlns attribute in order to conform strictly to the XHTML MP standard, although currently most WAP browsers will still display the XHTML MP page correctly even if the xmlns attribute is missing.
The <head> and </head> tags are used to specify the start and the end of the document head respectively. Information about the document is placed in the document head. The <head> element is used as a container for other elements such as <title> and <link>. The <title> element and the <link> element are used to specify the title of the XHTML MP document and the URL to the external cascading style sheet respectively. Metadata of the XHTML MP document is also placed in the document head. Metadata is specified using the <meta> element.
The <title> element is used to specify the title of an XHTML MP page. This element should be enclosed within the <head></head> tag pair. Most WAP browsers will display the title at the top of the screen. If the title is too long, WAP browsers will truncate the title to match the size of the title bar. WAP CSS styles cannot be used with the <title> element.
The <body> element is used as a container for the actual content. An XHTML MP file can only contain one <body> element, which means the deck and card concept of WML 1.x is not supported any more.
Text cannot be enclosed directly in the <body></body> tag pair. For example, the following markup code is incorrect in XHTML MP:
Hello world. Welcome to our XHTML MP tutorial.
To correct the above XHTML MP markup code, the text in the document body must be enclosed in some other elements such as paragraphs (<p></p>), lists (<ul><li></li></ul> or <ol><li></li></ol>), headings (<h1></h1>, <h2></h2>...), etc. The following markup code is correct in XHTML MP:
<p>Hello world. Welcome to our XHTML MP tutorial.</p>
The <p> element is used to enclose a paragraph of text. Besides text, things such as anchor links and images can be included in the <p> element. WAP browsers always render a paragraph on a new line.
In HTML and WML 1.x, you can make use of the align attribute of the <p> element to change the horizontal alignment of a paragraph. Note that the align attribute has been removed in XHTML MP. To change the horizontal alignment of a paragraph of text in XHTML MP, you have to use the WAP CSS text-align property. For example, if you put the following WAP CSS style statement in your XHTML MP page's external style sheet, text in all paragraphs will be aligned to the right.
|Previous Page||Page 11 of 36||Next Page|
- 1. XHTML MP (XHTML Mobile Profile) Introduction
- 2. Development of Wireless Markup Languages
- 3. Advantages of XHTML MP
- 4. WML Features Lost in XHTML MP
- 5. Syntax Rules of XHTML MP
- 6. XHTML MP MIME Types and File Extension
- 7. XHTML MP Document Structure
- 8. XHTML MP Generic Metadata
- 9. Comments in XHTML MP
- 10. Line Breaking in XHTML MP
- 11. XHTML MP Horizontal Rules
- 12. XHTML MP Headings
- 13. Font Style in XHTML MP
- 14. XHTML MP Preformatted Text
- 15. XHTML MP Lists
- 16. XHTML MP Images
- 17. XHTML MP Tables
- 18. Anchor Links in XHTML MP
- 19. XHTML MP Selection Lists
- 20. XHTML MP Input Elements
- 21. Submitting Form Data to the Server in XHTML MP