Page 90 - DCAP512_WAP_AND_WML
P. 90

WAP & WML




                    Notes          Elements Attributes

                                      Attributes provide additional information about an element.
                                      A certain group of attributes will apply to a certain set of elements.
                                   <card id = “code”>
                                   <do type=”accept” label=”exit”>

                                   <option value=”d”>
                                   <p align=”center”>

                                   Paragraphs and Line Breaks

                                   A WML card can be set up to display the paragraph and line break functions of WML:
                                   <?xml version="1.0"?>
                                   <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
                                   "http://www.wapforum.org/DTD/wml_1.1.xml">
                                   <wml>
                                   <card title="Paragraphs">
                                   <p>

                                   This is a paragraph
                                   </p>
                                   <p>
                                   This is another<br/>with a line break
                                   </p>
                                   </card>
                                   </wml>

                                   The result MIGHT look like this in your mobile phone display:
                                    ——— Paragraphs ———
                                   This is a paragraph This is another with a line break

                                   Paragraph Attributes

                                   Table 6.3 gives the list of Paragraph Attributes.
                                                                     Table  6.3

                                     Attribute           Purpose
                                     align=”left”        Aligns text to the left. This is the default.
                                     align=”center”      Aligns text to the center
                                     align=”right”       Aligns text to the right
                                     mode=”wrap”         Lets the browser break long lines and “wrap” to display remainder on
                                                         next line. This is the default.
                                     mode=”nowrap”       Forces the browser to not break a long line of text




          84                                LOVELY PROFESSIONAL UNIVERSITY
   85   86   87   88   89   90   91   92   93   94   95