Using basic CSS selectors

For applying styles to page elements, web developers have become familiar with a small, but powerful and useful, group of selection methods that work across all browsers. Those methods include selection by an element’s ID, CSS class name, tag name, and the DOM hierarchy of the page elements. Here are some examples to give you a quick refresher.
  1. a—This selector matches all link (<a>) elements.
  2. #specialIDThis selector matches elements that have an id of specialID.
  3. .specialClass—This selector matches elements that have the class of specialClass.
  4. a#specialID.specialClass—This selector matches links with an id of specialID and a class of specialClass.
  5. p a.specialClass—This selector matches links with a class of specialClass declared within <p> elements.

– Ananth Ramasamy Meenachi www.msarm.com

Advertisements

About msarm

Aspiring Enterprise Architect.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s