Universal Selector in CSS

The universal selector * allows you to select all elements.

Example

Let's select all the elements and color them red:

css* {
  color: red;
}

Example

Let's select all the elements inside the div tag and color them red:

cssdiv * {
  color: red;
}

Example

Let's select all the elements directly inside the div tag and color them red:

cssdiv > * {
  color: red;
}

Example

Let's select all span tags that are inside any tag that is inside a div tag:

cssdiv * span {
  color: red;
}

Practical tasks

Задание 1

Given code:

html<main>
  <p>---</p>
  <p>---</p>
  
  <div>
    <p>+++</p>
    <p>+++</p>
  </div>
  <section>
    <p>+++</p>
    <p>+++</p>
  </section>
</main>

Write a selector that will select all paragraphs that are inside any parent inside the main tag.