1. Home
  2. Computing & Technology
  3. Web Design / HTML

What is a CSS Selector?

By , About.com Guide

A CSS selector is the part of a CSS style call that identifies what part of the Web page should be styled. The selector contains one ore more properties that define how the selected HTML will be styled.

The CSS Selectors

There are several different types of selectors:

Format CSS Styles

The format of a CSS style looks like this:

selector { style property : style ; }

Separate multiple selectors that have the same style with commas, for example:

selector1 , selector2 { style property : style ; }

Always Test Your CSS Selectors

Not all browsers support all the CSS selectors. So be sure to test your selectors in as many browsers on as many operating systems as you can.

Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. CSS Selectors
  6. CSS Selectors - What is a CSS Selector>

©2010 About.com, a part of The New York Times Company.

All rights reserved.