What is the difference between descendant selector and child selector. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

What is the difference between descendant selector and child selector.

8th Aug 2020, 12:31 AM
Khaled Jibril
Khaled Jibril - avatar
2 Answers
0
Let we have <main> <div> <h1> </h1></div></main> If you have access main tag through chid selector you can select div but not h1 . But through desendent selector you can select all tag inside main . In simple child select child only But desendent can select child ,grandchild,supergrand child....
8th Aug 2020, 1:52 AM
Divya Mohan
Divya Mohan - avatar