visitor activity monitorvisitor activity monitor

PROJECT CODE

                                            The Developers Choice!!!!
                                                                                                            Home | About Us | Contact Us

CSS TUTORIALS

Combinators:

What is CSS Combinators
A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator.
There are four different combinators in CSS3:
  • descendant selector
  • child selector
  • adjacent sibling selector
  • general sibling selector
What is Descendant Selector
The descendant selector matches all element that are descendants of a specified element.
The following example selects all <p> elements inside <div> elements:
How to use Descendant Selector
Example
div p {
background-color: green;
}

What is Child Selector
The child selector selects all elements that are the immediate children of a specified element.
The following example selects all <p> elements that are immediate children of a <div> element:
How to use Child Selector
Example
div > p {
background-color: green;
}
   
What is Adjacent Sibling Selector
The general sibling selector selects all elements that are siblings of a specified element.
The following example selects all <p> elements that are siblings of <div> elements:
How to use Adjacent Sibling Selector
Example
div ~ p {
background-color: green;
}
All Rights Reserved with Project code