Sunday, 12 August 2012

css selector tutorial


Introduction of CSS SELECTOR


css selector are used to select html tag. Using this we can manipulate and apply css. css use property-value concept where according our requirement we can use our desired css.
  Syntex :
    selector
    {
      property :value;
    }
 

Types of css selector

  1. ID selector : This type of selector uses id of html element. this css apply to specific id element.
        Syntex :
        #selector-id
        {
          property :value;
        }
        
    Click to practice online id-selector example
  2. Class selector : This type of selector uses class name of html element. this css apply all html elements which have slector class.
        Syntex :
        #selector-class name
        {
          property :value;
        }
        
    Click to practice online class-selector example
  3. Direct HTML TAG as selector : This type of selector uses html tag name to apply css.
        Syntex :
        #HTML TAG NAME
        {
          property :value;
        }
        
    Click to practice online tag-selector example

No comments:

Post a Comment