12.2. Setting the Font Size (font-size Property)

The font-size WCSS property is used to set the font size of some text. It takes a length value that we discussed in the "Common Types of Property Value: Length" section of this WCSS tutorial. Here is an example that illustrates its use:


p {font-size: 12pt}


The above WAP CSS style statement specifies that the font size of the text enclosed in <p></p> tags should be 12 points.

The font-size WCSS property also accepts the following keywords: xx-small, x-small, small, medium, large, x-large and xx-large. The default value of the font-size WCSS property is medium. The keywords smaller and larger are also valid property values.


12.3. Setting the Font Style: Italic, Bold and Underline (font-style, font-weight and text-decoration Properties)

Two font styles, italic and bold, are used frequently in many mobile Internet applications. To specify the italic font style to some text, you need to use the font-style WCSS property. For example:


p {font-style: italic}


The above WAP CSS style statement specifies that the text enclosed in <p></p> tags should be displayed in italics. The same effect can be achieved with the XHTML MP tag <i>.

To specify the bold font style to some text, you need to use the font-weight WCSS property. For example:


h1 {font-weight: bold}


The above WAP CSS style statement specifies that all level-1 headings should be displayed in bold type. The same effect can be achieved with the XHTML MP tag <b>.

Note that there is no <u> tag in XHTML MP. To underline some text, the text-decoration WCSS property must be used, like this:


h1 {text-decoration: underline}


The above WAP style statement specifies that all level-1 headings should be underlined.


Previous Page Page 17 of 39 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page