Specified question 5 for HTML in questionw
This commit is contained in:
parent
700f1d9701
commit
1514d33f1c
14
questions.md
14
questions.md
|
@ -22,8 +22,18 @@
|
||||||
|
|
||||||
## 5. What CSS selector matches all the p elements inside the article element in the following HTML?
|
## 5. What CSS selector matches all the p elements inside the article element in the following HTML?
|
||||||
|
|
||||||
```HTML
|
Here, we have two options. One could either do
|
||||||
|
|
||||||
|
```CSS
|
||||||
article p {}
|
article p {}
|
||||||
```
|
```
|
||||||
|
|
||||||
This specifies all `<p>` elements inside the `<article>`, in contrast to `article > p {}` which would only specify `<p>` elements directly beneath the `<article>`.
|
which specifies all `<p>` elements inside the `<article>`.
|
||||||
|
|
||||||
|
The other options would be
|
||||||
|
|
||||||
|
```CSS
|
||||||
|
article > p {}
|
||||||
|
```
|
||||||
|
|
||||||
|
which would only specify `<p>` elements directly beneath the `<article>`. But since there are no `<p>` subchildren, both will work.
|
||||||
|
|
Loading…
Reference in New Issue