Different Types of Selectors

Preferences - Do not show ads

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.

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.

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