Home > Articles > Networking > Wireless/High Speed/Optical

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Font Styles

As we have mentioned before, most microbrowsers do not support a range of font styles or sizes. In addition, most design and style elements have been depreciated for the sake of separating document structure from style. For these reasons, XHTML Basic does not include the font element in the specification.

A few of the leading mobile microbrowsers do, however, support a limited ability to manipulate font size and color. Of the two, font color is most likely to be supported by i-mode microbrowsers. Because many microbrowsers support text color attributes for the body element, they are also able to change text color at a specific point within the document through the use of the font element. For example, look at the code in Listing 4. You can see that the <font> tag is placed around just the text that is to be changed.

Listing 4 - Font Style for Adding Color

<title>Body Attributes</title>
<body bgcolor="navy" text="silver">
<h1>Body Colors</h1>
Navy background, Silver body text, and <font
color="yellow">yellow</font> highlights.

The font element by itself will not change the text in any way; it requires one of the attributes to make text within the tag appear different. In this example, the attribute for text color was used to make the text within the font tags yellow. The color attribute for the font element references colors in the same way as the body bgcolor and text attributes. You can specify the hexadecimal color code, or simply reference the color name that you want to use.

  • + Share This
  • 🔖 Save To Your Account