8. Different Types of Selectors

Selectors are used to specify what XHTML MP elements should a WAP CSS style rule be applied to. Up to now, we have used only one kind of selector called the type selector in cascading style sheets. There are other kinds of selectors available in WCSS and they can be very useful to you. You can learn some of the more useful ones below.


8.1. Type Selector

In all the WAP CSS examples mentioned previously, we used XHTML MP element names as the selector. Such kind of selector is called the type selector. It should be noted that element names are case-sensitive in XHTML MP and they must be in lowercase. This means type selectors in WCSS cascading style sheets must also be in lowercase. For example, the following WCSS code is incorrect because the type selector "H1" is not in lowercase.


H1 {
  font-style: italic
}


This is the correct version of the above WCSS code:


h1 {
  font-style: italic
}


The above style statement specifies that the style rule "font-style: italic" should be applied to all <h1> tags.


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