Specify WCSS Styles with the Style Attribute (Inline Styles)

Preferences - Do not show ads

The style attribute is used to specify WCSS styles for a single element. This attribute is present in all XHTML MP elements that WCSS styles can be applied to. WCSS styles specified in this way are called inline styles.

Specifying WCSS inline styles should be avoided most of the time, since using this method will mix up the XHTML MP markup and the WCSS styles completely.

This XHTML MP/WAP CSS example demonstrates how to use inline styles:


<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <title>WCSS Tutorial</title>

    <h1 style="color: white; background-color: black">Table of Contents</h1>
    <hr style="color: blue"/>
    <p style="font-style: italic">
      WCSS Tutorial Chapter 1<br/>
      WCSS Tutorial Chapter 2<br/>
      WCSS Tutorial Chapter 3<br/>

This is the result of the above XHTML MP/WAP CSS example in some mobile phone browsers:

Sony Ericsson T610

Nokia Mobile Browser 4.0

Page 6 of 39 Previous Page | Next Page
Contents at a Glance
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?

WCSS Tutorial Table of Contents WCSS Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page