What is Descendant Selector?

What is Descendant Selector?

Default Asked on June 3, 2018 in CSS.
Add Comment
1 Answer(s)

    The descendant selector matches all elements that are descendants of a specified element.
    Some Examples:

    
    ul li { }
    
    header h1 { }
    
    footer p { }
    
    

    If we consider as ul li { } that means “any list item that is a descendant of an unordered list.” Descendant means anywhere nested within it in the DOM tree or object. It could be a direct child Or could be five levels deep, it is still a descendant.

    Default Answered on December 1, 2018.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.