CSS-104

Week 4 Assignment

Cascade and Specificity

1. Which of the below css rule will apply?

p {
  color: red;
}

p {
  color: maroon !important;
}

2. Which CSS rule will apply to the first line of the paragraph?

p::first-line {
  line-height: 1.5;
}

body p::first-line {
  line-height: 1.7;
}

3. Which CSS rule will be applied to the button when it is focused?

4. In the following example, what will be the color of the span element with the attribute data-example?

5. If a <p> element is inside both the <div> with id "container" and the <div> with class "sidebar," what color will the text be?

6. If a <p> element is inside an element with id "header," what font size will be applied?

7. What background color will be applied when you hover over a <p> element inside an element with class "container"?

8. What font style will be applied to the first line of a <p> element inside an element with id "main-content"?

9. If a <p> element is both inside thewith id "sidebar" and the <div> with id "content," what color will the text be?

10. If a <p> element is inside both thewith id "container" and the <div> with class "sidebar," and has a class of "highlight," what color will the text be?

11. If a <p> element has a class "important-text" and is inside an element with id "header" and awith class "content," what font size will be applied?

11. What background color will be applied when you hover over a <p> element inside an element with class "container," having a class "highlight"?

12. What font style will be applied to the first line of a <p> element with the class "special" inside an element with id "main-content"?

Last updated