Question

In: Computer Science

1. What is the difference between a child selector and a descendant selector? In your answer,...

1. What is the difference between a child selector and a descendant selector? In your answer, you must (1) explain what they are for, (2) provide an example child selector, and (3) provide an example descendant selector.

Solutions

Expert Solution

Child Selector is used to match all components of a given component that are child. It provides two elements the relationship. The selector TAG1 > TAG2 chooses the components that are particular parent's kids. The operand on the left of > is the mother and the operand on the right is the component of the kids.

Descendant selector is used to pick all components of the item that are baby (not a particular element). It selects the components within the components i.e. it mixes two selectors so that if they have an ancestor component matching the first selector, elements matched by the second selector are chosen.

Example:

<!DOCTYPE html>

<html>

<head>

    <title>

        Child and Descendant Selector

    </title>

    <style>

        #firstDiv>h2 {

            font-size:20px;

                color:green;

        }

                                #secondDiv h2 {

            font-size:20px;

color:blue;

        }                     

    </style>

</head>

<body style = "text-align:center;">

                <div id="firstDiv">

        <h2>

            Direct H2:This one with child selector

        </h2>

        <div>

            <h2>Indirect H2:This one with child selector</h2>

        </div>

    </div>

    <div id="secondDiv">

        <h2>

            Direct H2:This one with descendant selector

        </h2>

        <div>

            <h2>Indirect H2:This one with descendant selector </h2>

        </div>

    </div>

</body>

</html>

Output:


Related Solutions

1. What is the difference between Child abuse or neglect and describe the symptoms. 2. If...
1. What is the difference between Child abuse or neglect and describe the symptoms. 2. If you found or suspect a youth is being abused or neglected, would you let the parent know you are reporting the incident? Why or Why Not?
Answer these questions. 1.What is the difference between Minority status and Culture? What is the difference...
Answer these questions. 1.What is the difference between Minority status and Culture? What is the difference between Western and Eastern culture? What is the difference between a stigma vs misdiagnosing a mental illness? What are 3 norms of etiquette in across cultures? What is somatization? What are three specific types of cultural concepts? What are 3 ways immigrants face when arriving to a United States? What is the difference between acculturation and assimilation? What are some ways you feel like...
Is there a difference between the sex and gender of a child? If so, what determines...
Is there a difference between the sex and gender of a child? If so, what determines the sex and what determines the gender? If there is no difference, elaborate on what would be (could be) influential?
Is there a difference between the sex and gender of a child? If so, what determines...
Is there a difference between the sex and gender of a child? If so, what determines the sex and what determines the gender? If there is no difference, elaborate on what would be (could be) influential?
What is the difference between a call and a put option? (Be clear in your answer.)...
What is the difference between a call and a put option? (Be clear in your answer.) What does the exercise—or strike—price denote? Of the five inputs discussed, what are three important inputs in the Black-Scholes option pricing model? For each of the three that you have chosen, what happens to the call option premium, all else being equal, when that variable increases?
What is the difference between disabilities and handicaps? Include in your answer why it is important...
What is the difference between disabilities and handicaps? Include in your answer why it is important to avoid "labels" when speaking about these individuals. What does intelligence mean? Include in your answer the differences between general, fluid and crystallized intelligence. What is the theory of multiple intelligence? Hint: Your answer cannot be considered complete without mentioning Howard Gardner and the eight intelligences. What is the triarchic theory of successful intelligence? Hint: Your answer cannot be considered complete without mentioning Robert...
Answer these in detail: 1) What is the difference between an Ingroup and an Outgroup? Give...
Answer these in detail: 1) What is the difference between an Ingroup and an Outgroup? Give an example. 2) Explain Stereotype Threat. Give an example. 3) Discuss the 3 components of prejudice. Give examples. 4) How are personal, institutional and cultural discrimination different? Give 3 examples of each. 5) What is the Melting Pot Ideal and why has it been replaced by the Multicultural Ideal. Explain in detail.
What is the difference between direct and indirect action of radiation on DNA? Type your answer...
What is the difference between direct and indirect action of radiation on DNA? Type your answer by computer writing not by hand writing
What is the underlying difference between vertical control and vertical integration? In your answer describe the...
What is the underlying difference between vertical control and vertical integration? In your answer describe the concepts of vertical control and vertical integration.
what is the difference between reporting, responding, and ultimately preventing child abuse on the part of...
what is the difference between reporting, responding, and ultimately preventing child abuse on the part of nursing educators.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT