1. Trang chủ
  2. » Công Nghệ Thông Tin

Webmaster''''s Guide to the Wireless Internet part 14 ppt

10 205 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 105,73 KB

Nội dung

102 Chapter 3 • A New Markup: WML The <i> Element The <i> element signifies that the text contained within should be rendered by the user-agent in an italic font. However, <em> is the recommended use to sig- nify emphasis.Table 3.13 lists the attribute for the <i> element. Table 3.13 Attribute for the <i> element Attribute Name Description xml:lang The natural or formal language of the element The following is an example of the syntax for the <i> element: This is normal text but <i>this is italic text</i>. The <img> Element The <img> element allows a wireless bitmap (WBMP) image to be included. See Table 3.14 for a list of attributes for the <img> element. Table 3.14 Attributes for the <img> Element Attribute Name Description align Specifies how the image should be aligned with refer- ence to the text flow it appears within. Possible options are one of top, middle, or bottom. alt Alternate text that can be displayed when the image is unavailable. height The height of the image in pixels. hspace The amount of padding that should be applied to the image horizontally. localsrc An image, contained internally within the device, that can be displayed as an alternative. src The URI where the image to be displayed resides. vspace The amount of padding that should be applied to the image vertically. width The width of the image in pixels. xml:lang The natural or formal language of the element. www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 102 A New Markup: WML • Chapter 3 103 The following is an example of the syntax for the <img> element: <img src="logo.wbmp" alt="Company Logo" height="30" width="60"/> The <input> Element The <input> element allows data to be entered by the user; it features some useful methods of constraining the input via the format attribute, which can mask the content to ensure that only the input you want is sent to the server. See Table 3.15 for a list of attributes for the <input> element. Table 3.15 Attributes for the <input> Element Attribute Name Description emptyok This is either true or false, and if set to true, the element will allow the input value to be empty. format The format attribute allows conditions to be set that must be met before the data entry will be accepted. All other entries will be ignored. These options are available: A Only uppercase, non-numeric characters a Only lowercase, non-numeric characters N Only numeric characters X Any uppercase character x Any lowercase character M Any character (the default value) m Any character but assumed to be lowercase *f Appearing at the end of the format string, this allows any number of characters and must be pre- ceded by one of the above characters nf A number of characters (n) may be entered where f is one of the above formatting characters (other than *f) \c Displays the next character (c) in the text field. Useful for formatting phone numbers and so on maxlength The maximum number of characters that can be entered into the input field by the user. name The name of the variable that will be set for the input element. size The width of the input field in characters. tabindex The position in tabbing order. title A short string of text that identifies the element. www.syngress.com Continued 159_wg_wi_03 10/22/01 4:33 PM Page 103 104 Chapter 3 • A New Markup: WML type This can be either text or password. When password is specified as the attribute, input is masked. This helps to keep private data private from casual onlookers. value A default value for the input element. xml:lang The natural or formal language of the element. The following is an example of the syntax for the <input> element: <input name="Name" type="text" value="Richard"/> <card> <p> Name: <input name="Name" type="text" value="Richard"/><br/> Favorite Ice-cream: <input name="Ice-cream" type="text"> </p> </card> NOTE The name attribute is required at all times and the emptyok attribute defaults to false if not set to true. Do not rely on the size attribute to aid layout because not all devices support this. The <meta> Element The <meta> element provides meta information in the head of a WML deck as a name and value pair.The <meta> element cannot appear anywhere in the deck other than in the head. See Table 3.16 for a list of attributes for the <meta> element. www.syngress.com Table 3.15 Continued Attribute Name Description 159_wg_wi_03 10/22/01 4:33 PM Page 104 A New Markup: WML • Chapter 3 105 Table 3.16 Attributes for the <meta> Element Attribute Name Description content The value of the property. forua This is either true or false, and if false, the meta infor- mation must be removed before the content is sent to the user. Conversely, if true, the header information must be sent to the user. http-equiv This allows an HTTP header to be set as per RFC2068. name The name of the property. scheme A structure or form that can be used to interpret the property value. The following is an example of the syntax for the <meta> element: <head> <meta content="charset" value="character-set=ISO-10646-UCS-2"/> </head> The <noop> Element The <noop> element specifies that no operation should be carried out by the user-agent.Table 3.17 lists the attribute for the <noop> element. Table 3.17 Attribute for the <noop> Element Attribute Name Description xml:lang The natural or formal language of the element The following is an example of the syntax for the <noop> element: <noop>Nothing to be done here</noop> The <onevent> Element The <onevent> element binds an event to an enclosed task.Table 3.18 lists the attribute for the <onevent> element. www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 105 106 Chapter 3 • A New Markup: WML Table 3.18 Attribute for the <onevent> Element Attribute Name Description type The intended use of the element. This attribute is required. The following is an example of the syntax for the <onevent> element: <onevent type="onenterbackward"> <go href="deck.wml"/> </onevent> The <optgroup> Element The <optgroup> element allows the grouping of options hierarchically to pro- vide an indication to the user-agent of how the content should be grouped and rendered. See Table 3.19 for a list of attributes for the <optgroup> element. Table 3.19 Attributes for the <optgroup> Element Attribute Name Description title A short text string that is used to identify the group and which may be displayed. xml:lang The natural or formal language of the element. The following is an example of the syntax for the <optgroup> element: <optgroup title="Ice-Creams"> <option value="Strawberry"/> <option value="Vanilla"/> <option value="Chocolate"/> </optgroup> The <option> Element The <option> element defines an option in a list and occurs within a <select> element. See Table 3.20 for a list of attributes for the <option> element. www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 106 A New Markup: WML • Chapter 3 107 Table 3.20 Attributes for the <option> Element Attribute Name Description onpick The URI to navigate to upon selection by the user title A short text string that is used to identify the option value The value of the option xml:lang The natural or formal language of the element The following is an example of the syntax for the <option> element: <option title="Strawberry" value="Strawberry"/> NOTE See the <select> element for further examples of option lists. The <p> Element Text that appears within the <p> element is designated as a paragraph. See Table 3.21 for a list of attributes for the <p> element. Table 3.21 Attributes for the <p> Element Attribute Name Description align This can be either left (the default), right, or center— though support for this is varied. mode This can be either wrap or nowrap and specifies whether the text within the paragraph should wrap where it is too long to fit on the display screen. The following is an example of the syntax for the <p> element: <p> This is a paragraph of text that will wrap on reaching the edge of the screen and is left aligned by default. </p> www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 107 108 Chapter 3 • A New Markup: WML The <postfield> Element The <postfield> element specifies a name and value pair that will be sent to the server as part of a URL request.You can use the <postfield> element with the <go> element (described previously) to provide a variety of options for transmit- ting the information. See Table 3.22 for a list of attributes for the <postfield> element. Table 3.22 Attributes for the <postfield> Element Attribute Name Description name The name of the field value The value of the field The following is an example of the syntax for the <postfield> element: <postfield name="Ice-cream" value="Chocolate"/> The <prev> Element The task element <prev> specifies that navigation should take the user one step back in the history stack.The following is an example of the syntax for the <prev> element: <anchor> <prev/>Back </anchor> The <refresh> Element The <refresh> element specifies a contextual task to be performed by the user- agent. See the <setvar> element for more information on using <refresh>. The <select> Element The <select> element allows the user to make a selection from a list of options (see the <option> element described earlier).Table 3.23 lists the attributes for the <select> element. www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 108 A New Markup: WML • Chapter 3 109 Table 3.23 Attributes for the <select> Element Attribute Name Description Iname The name of the variable that will be set with the option value. ivalue The default selection value. multiple This is either true or false and signifies whether multiple options may be selected. The default is false. name The name of the variable to be set. tabindex This is used to set the tabbing position of the current element. title The title of the selection list that may be used to aid identification of the purpose of the list. value The value that will be applied to a variable when the option is selected. xml:lang The natural or formal language of the element. The following is an example of the syntax for the <select> element: <select name="Ice-cream" value="Chocolate" title="Ice-cream:"> <option value="Strawberry">Strawberry</option> <option value="Vanilla">Vanilla</option> <option value="Chocolate">Chocolate</option> </select> The <setvar> Element The <setvar> element is used to set a variable within the user-agent after a task is executed. See Table 3.24 for a list of attributes for the <setvar> element. Table 3.24 Attributes for the <setvar> Element Attribute Name Description name The name of the variable value The value of the variable The following is an example of the syntax for the <setvar> element: <setvar name="variable1" value="one"/> <setvar name="variable2" value="two"/> www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 109 110 Chapter 3 • A New Markup: WML The <small> Element The <small> element indicates that the user-agent should render the text in a smaller font size than the base font size for the device.Table 3.25 lists the attribute for the <small> element. Table 3.25 Attribute for the <small> Element Attribute Name Description xml:lang The natural or formal language of the element The following is an example of the syntax for the <small> element: This text is a normal size <small>but this text is smaller!</small> The <strong> Element The <strong> element indicates that the contained text should be rendered with strong emphasis.Table 3.26 lists the attribute for the <strong> element. Table 3.26 Attribute for the <strong> Element Attribute Name Description xml:lang The natural or formal language of the element The following is an example of the syntax for the <strong> element: This text is normal but <strong>this text is strongly emphasized</strong>. The <table> Element The <table> element, along with the <tr> and <td> elements, is used to create columns and rows of text and/or images within a card. See Table 3.27 for a list of attributes for the <table> element. www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 110 A New Markup: WML • Chapter 3 111 Table 3.27 Attributes for the <table> Element Attribute Name Description align Specifies how the content should be laid out; Allowable values are L (left), C (center), and R (right). columns The number of columns for the row set. title The title of the selection list that may be used to aid identification of the purpose of the list. The following is an example of the syntax for the <table> element: <table align="left" columns="1" title="Ice-creams"> </table> The <tr> Element The <tr> element signifies a table row.The following is an example of the syntax for the <tr> element: <table align="left" columns="1" title="Ice-creams"> <tr> </tr> </table> The <td> Element The <td> element signifies a cell that contains the text or image.Table 3.28 lists the attribute for the <td> element. Table 3.28 Attribute for the <td> Element Attribute Name Description xml:lang The natural or formal language of the element The following is an example of the syntax for the <td> element: <table align="left" columns="1" title="Ice-creams"> www.syngress.com 159_wg_wi_03 10/22/01 4:33 PM Page 111 . be either wrap or nowrap and specifies whether the text within the paragraph should wrap where it is too long to fit on the display screen. The following is an example of the syntax for the <p>. can be entered into the input field by the user. name The name of the variable that will be set for the input element. size The width of the input field in characters. tabindex The position in. whether multiple options may be selected. The default is false. name The name of the variable to be set. tabindex This is used to set the tabbing position of the current element. title The

Ngày đăng: 04/07/2014, 02:20