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 |
- 1. WCSS (WAP CSS) Introduction
- 2. Wireless CSS and Wireless Profile CSS
- 3. Advantages of Using WAP CSS Style Sheets on Mobile Internet Sites
- 4. Disadvantages of Using WAP CSS Style Sheets on Mobile Internet Sites
- 5. Syntax Rules of WCSS
- 6. Comments in WCSS
- 7. How to Apply WCSS Styles to an XHTML MP Document
- 8. Different Types of Selectors
- 9. Div and Span Element of XHTML MP
- 10. Cascading Rules for Handling Multiple Groups of WCSS Styles Applied to the Same Element
- 11. Common Types of Property Value
- 12. WCSS Font and Text Properties
- 13. WCSS List Properties
- 14. WCSS Color Properties
- 15. WCSS Border Properties
- 16. WAP Specific Extensions to CSS
- 17. WCSS Access Key Extension
- 18. WCSS Input Extension
- 19. WCSS Marquee Extension
- 20. Matching WCSS Cascading Style Sheets to Different User Agents