div , p
div p
div > p
div + p
div ~ p
Answer
- div, p - Selects all
<div>
elements and all<p>
elements - div p - Selects all
<p>
elements that are anywhere inside a<div>
element - div > p - Selects all
<p>
elements where the immediate parent is a<div>
element - div + p - Selects all
<p>
elements that are placed immediately after a<div>
element - div ~ p - Selects all
<p>
elements that are anywhere preceded by a<div>
element
- Every
<a>
element whose href attribute value begins withhttps
. - Every
<a>
element whose href attribute value ends with.pdf
. - Every
<a>
element whose href attribute value contains the substringcss
.
Answer
-
a[href^="https"]
-
a[href$=".pdf"]
-
a[href*="css"]