WML learning 3 display text

Source: Internet
Author: User
Tags bmp image

Show text

WML is basically the same as HTML in text display. The text section is between <p align = "alignment" mode = "wrapmode"> and </p>. The align attribute specifies the alignment of the text section. The default value is left, you can select "right" and "center" for other options. The "mode" attribute specifies whether to automatically wrap a line when no text is displayed. The default value is "automatically wrap". If "nowrap" is selected, it is displayed in one line, the browser displays all text through a mechanism similar to a horizontal scroll bar.

The line feed label is also <br/>. Here, replace it. If there are multiple <input> or <select> labels in the form, do not use them. <br/>, otherwise, the browser will regard the form as a breakpoint and display it on pages.

Text modifiers include <B>, <I>, <u>, <em>, <strong>, <big>, and <small>, which have the same meaning as those in HTML.

The display tag of the table is similar to that of HTML, use <table title = "name" align = "left | right | center" columns = "columns">, <tr>, and <td> for display, the title attribute of <table> is used to name the table. The columns attribute specifies the number of columns in the table. The value cannot be 0. The optional align attribute is the same as the align attribute mentioned earlier. A table can contain text and images.

Test1.wml

--------------

<? Xml version = "1.0"?>

<! DOCTYPE wml PUBLIC "-// WAPFORUM // dtd wml 1.1 //" http://www.wapforum.org/DTD/wml_1.1.xml ">

<Wml>

<Card>

<P align = "center">

<I> Hello </I> <br/>

<B> <I> World! </I> </B>

<Table title = "mytable" align = "right" columns = "2">

<Tr>

<Td> 1-1 </td>

<Td> 1-2 </td>

</Tr>

<Tr>

<Td> 2-1 </td>

<Td> 2-2 </td>

</Tr>

</Table>

</P>

</Card>

</Wml>

Show Image

The labels for displaying images (1-bit black-and-white BMP image) are similar to HTML, , in the attribute, alt and src are mandatory and optional. In addition, you must note that should be placed in <p>, but not in <do> and <option> and other functional and menu tags.

* The alt attribute is used to specify the text to be displayed when the mobile phone does not support image display.

* The src attribute specifies the image URL, but when the following localsrc attribute is available, the mobile browser ignores the src attribute.

* The localsrc attribute is used to specify an icon in the ROM of the mobile phone. If no icon is found, go to the UP. Link Server to find the icon.

* The optional align attribute is used to indicate the alignment of the image and the text of the current row. The default value is bottom, and the optional values are to and middle.

* The height, width, vspace, and heat map attributes specify the image length and distance from the surrounding text. Currently, not all WAP mobile phones support these attributes.

Test2.wml

---------------

<? Xml version = "1.0"?>

<! DOCTYPE wml PUBLIC "-// WAPFORUM // dtd wml 1.1 //" http://www.wapforum.org/DTD/wml_1.1.xml ">

<Wml>

<Card>

<P align = "center"> </p>

</Card>

</Wml>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.