The id and class Selectors in CSS

To set a style for a HTML element, CSS allows you to specify your own selectors called

  1. id selector and
  2. class Sselector


The id Selector:
The id selector is used to specify a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with a "#".

The class Selector:
The class selector is used to specify a style for a group of elements. This allows you to set a particular style for many HTML elements with the same class.The class selector uses the HTML class attribute, and is defined with a "."

Unlike the id selector, the class selector is most often used on several elements.

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger