Question

Use only three context selectors SPACE, >, and +, add document level CSS code to the...

Use only three context selectors SPACE, >, and +, add document level CSS code to the HTML file below to implement styles required in the body portion of the HTML file.

<body>
   <p> Here should be yellow </p>

<div><p> Here should be cyan </p>

<div>Content of this division should be brown <p> Some text </p>

       </div>
       <p> Here should be red </p>
       <p> Here should be green </p>
       <div>

<div><p> Here should be brown </p> </div>
<div>

             <p> Here should be pink </p>
          </div>
      </div>
   </div>
   <p> Here should be blue </p>
</body>

Note:
1) Only three context selectors specified above can be used. Using other

selectors, inline CSS or external CSS, will cause 50 points deduction.
2) Use as least number of selectors as possible, otherwise 10 points deduction will be

applied.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

body > p{
   color: yellow;
}

div{
   color: brown;
}

div > p {
   color: cyan;
}

div + p {
   color: red;
}

div + p + p {
   color: green;
}

div div p {
   color: brown;
}

div div + div p {
   color: pink;
}

body > div + p {
   color: blue;
}

Add a comment
Know the answer?
Add Answer to:
Use only three context selectors SPACE, >, and +, add document level CSS code to the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT