+ 2
Can anyone explain ..what is combinators in CSS in detail???
Css
4 Answers
+ 2
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:
-descendant selector (space)
-child selector (>)
-adjacent sibling selector (+)
-general sibling selector (~)
+ 1
Ja Play but what is the requirement of these combinators
0
All programming languages will be developed to make somthing easier. Thus for a solution are at the end more ways and possibilities.
Depending of your code / webside design can be a way more helpful than other. That means you can for example style your webside with shorter code, which can be again used and is easier to support.
Easier to support means you have to change for example only one statement.
This is good to know all, what will be allowed in a language. So you can get many ideas from which you could choose, how you want to code your solution.
0
If you don't want to give id /class to all your html tag in order to keep your code clean .
Your will face difficulty in selecting tags ,used multiple time .
At that time you can use these combinator relation to select all tags just by adding id to a single element.