20. Matching WCSS Cascading Style Sheets to Different User Agents

As discussed earlier in this WCSS tutorial, a major advantage of introducing WCSS cascading style sheet to your mobile Internet application is that it enables you to place the content of your site in XHTML MP files and the presentation information in separate WAP CSS files.

For example, let's say you know that most of the users will visit your site using Nokia's mobile phone browser and Microsoft's Internet Explorer. When people use Nokia's mobile phone browser to visit your site, they view your site in a small screen; when people use Microsoft's Internet Explorer to visit your site, they view your site in a large screen of their PC. You can define a WAP CSS cascading style sheet for the Nokia mobile phone browser and another one for Microsoft Internet Explorer to control the layout of the content, so that your site can look good in both small and large screens. In this way, you just need to manage one version of your site's content, instead of managing one version for the Nokia mobile phone browser and another version for IE. Isn't that convenient?

To match the layout and formatting of your WAP site to different user agents, first you need to know how to detect the user agent. Since user agent detection is a big topic in mobile Internet application development, we will cover the details in a separate article in the future. In this section, we will only give an introduction of user agent detection and several simple examples that help you understand its use.

Previous Page Page 36 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