⊗mkPmSlSCP 72 of 250 menu

Practice on combinations of CSS selectors

Write a selector that will select paragraphs located inside div divs. Test your selector on the following code:

<div> <p> +++ </p> <p> +++ </p> </div> <div> <p> +++ </p> </div> <p> --- </p> <p> --- </p>

Write a selector that selects all h2 that are inside div divs. Test your selector on the following code:

<div> <h2>+++</h2> <p> --- </p> <p> --- </p> </div> <div> <h2>+++</h2> <p> --- </p> </div> <h2>---</h2> <p> --- </p>

Write a selector that selects all p paragraphs from an element with id equal to block. Test your selector on the following code:

<div id="block"> <h2>---</h2> <p> +++ </p> <p> +++ </p> </div> <div> <h2>---</h2> <p> --- </p> </div> <h2>---</h2> <p> --- </p>

Write a selector that selects all h2 from an element with id equal to block. Test your selector on the following code:

<div id="block"> <h2>+++</h2> <p> --- </p> <p> --- </p> <h2>+++</h2> <p> --- </p> </div> <div> <h2>---</h2> <p> --- </p> </div> <h2>---</h2> <p> --- </p>

Write a selector that selects all elements with the class bbb. Test your selector on the following code:

<div id="block"> <h2 class="bbb">+++</h2> <p class="bbb"> +++ </p> <p> --- </p> <h2 class="bbb">+++</h2> <p> --- </p> </div> <div class="bbb"> +++ </div> <h2>---</h2> <p class="bbb"> +++ </p>

Write a selector that selects all elements with class bbb from an element with id equal to block. Test your selector on the following code:

<div id="block"> <h2 class="bbb">+++</h2> <p class="bbb"> +++ </p> <p> --- </p> <h2 class="bbb">+++</h2> <p> --- </p> </div> <div class="bbb"> --- </div> <h2>---</h2> <p class="bbb"> --- </p>

Write a selector that selects all paragraphs p with class bbb. Test your selector on the following code:

<div id="block"> <h2 class="bbb">---</h2> <p class="bbb"> +++ </p> <p> --- </p> <h2 class="bbb">---</h2> <p class="bbb"> +++ </p> </div> <div class="bbb"> --- </div> <h2>---</h2> <p class="bbb"> +++ </p>

Write a selector that selects all h2 with class bbb. Test your selector on the following code:

<div id="block"> <h2 class="bbb">+++</h2> <p class="bbb"> --- </p> <p> --- </p> <h2 class="bbb">+++</h2> <p class="bbb"> --- </p> </div> <h2>---</h2> <p class="bbb"> --- </p> <h2 class="bbb">+++</h2> <p class="bbb"> --- </p>

Write a selector that selects all paragraphs p with class bbb from an element with id equal to block. Test your selector on the following code:

<div id="block"> <h2 class="bbb">---</h2> <p class="bbb"> +++ </p> <p> --- </p> <h2 class="bbb">---</h2> <p class="bbb"> +++ </p> </div> <div class="bbb"> --- </div> <h2>---</h2> <p class="bbb"> --- </p>

Write a selector that will select all elements with class bbb and elements with class xxx at the same time (that is, you need to group the selectors with a comma). Test your selector on the following code:

<h2 class="bbb">+++</h2> <p class="bbb"> +++ </p> <h2 class="xxx">+++</h2> <p> --- </p> <h2>---</h2> <p class="xxx"> +++ </p> <div class="bbb"> +++ </div>

Write a selector that will select all paragraphs p with class bbb and at the same time all h2 with class xxx. Test your selector on the following code:

<h2 class="bbb">---</h2> <p class="bbb"> +++ </p> <h2 class="xxx">+++</h2> <p> --- </p> <h2>---</h2> <p class="xxx"> --- </p> <div class="bbb"> --- </div>

Write a selector that selects all paragraphs p with class bbb from an element with id equal to block and simultaneously all paragraphs p with class xxx from an element with id equal to block. Test your selector on the following code:

<div id="block"> <h2 class="bbb">---</h2> <p class="bbb"> +++ </p> <h2 class="xxx">---</h2> <p> --- </p> <h2>---</h2> <p class="xxx"> +++ </p> <div class="bbb"> --- </div> <div class="xxx"> --- </div> </div> <h2 class="bbb">---</h2> <p class="xxx"> --- </p>

Write a selector that selects all elements with the class fff. Test your selector on the following code:

<div class="fff"> +++ </div> <h2 class="fff">+++</h2> <p class="fff"> +++ </p> <h2 class="bbb">---</h2> <p class="xxx"> --- </p>

Write a selector that selects all paragraphs p from an element with class fff. Test your selector with the following code:

<div class="fff"> <h2>---</h2> <p> +++ </p> <p> +++ </p> </div> <h2 class="fff">---</h2> <p class="fff"> --- </p>

Write a selector that selects all paragraphs p with class fff. Test your selector on the following code:

<div id="block"> <h2>---</h2> <p> --- </p> <p> --- </p> <p class="fff"> +++ </p> </div> <h2 class="fff">---</h2> <p class="fff"> +++ </p>

Write a selector that selects all elements with class bbb from an element with class fff. Test your selector on the following code:

<div class="fff"> <h2 class="bbb">+++</h2> <p> --- </p> <p> --- </p> <p class="bbb"> +++ </p> </div> <h2 class="fff">---</h2> <p class="bbb"> --- </p>

Write a selector that selects all h2 with class bbb from an element with class fff. Test your selector on the following code:

<div class="fff"> <h2 class="bbb">+++</h2> <p> --- </p> <h2 class="bbb">+++</h2> <p> --- </p> <p class="bbb"> --- </p> </div> <h2 class="bbb">---</h2> <p class="bbb"> --- </p> <p class="fff"> --- </p>
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline