0% found this document useful (0 votes)
23 views1 page

Css

The document explains CSS selectors and combinators, detailing how multiple simple selectors can be combined using combinators. It outlines four types of combinators: descendant selector, child selector, adjacent sibling selector, and general sibling selector, each with specific functions for selecting elements in relation to others. Additionally, it mentions the universal selector as a fifth type.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

Css

The document explains CSS selectors and combinators, detailing how multiple simple selectors can be combined using combinators. It outlines four types of combinators: descendant selector, child selector, adjacent sibling selector, and general sibling selector, each with specific functions for selecting elements in relation to others. Additionally, it mentions the universal selector as a fifth type.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

selectors

combinatiors

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 CSS:

1)descendant selector (space) The descendant selector matches all elements that are
descendants of a specified element.

-----------------------------------------------------------------------------------
---------------------------------------------------------------------------------
2)child selector (>)
The child selector selects all elements that are the children of a specified
element.
-----------------------------------------------------------------------------------
---------------------------------------------------------------------------------
3)adjacent sibling selector (+)
The adjacent sibling selector is used to select an element that is directly after
another specific element.
Sibling elements must have the same parent element, and "adjacent" means
"immediately following".

-----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
4)general sibling selector (~) The general sibling selector selects all elements
that are next siblings of a specified element.
E1~E2 ALL THE E2 TYPE OF ELEMENTS WHICH ARE SIBLINGS OF E1 THPE OF ELEMENTS
div~p
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
5) universal selector *

You might also like