Which selector targets all elements on the page?
A
# B
. C
* D
&
Analysis & Theory
`*` is the universal selector and it targets all elements.
What does `.menu` select?
A
All elements with id 'menu' B
All `<menu>` tags C
All elements with class 'menu' D
Only the first menu element
Analysis & Theory
`.menu` selects all elements with `class="menu"`.
Which selector targets an element with the id 'footer'?
A
.footer B
footer C
#footer D
*footer
Analysis & Theory
`#footer` selects the element with `id="footer"`.
What does `div p` select?
A
All `<div>` elements inside `<p>` B
All `<p>` elements inside `<div>` C
All `<p>` elements with class 'div' D
All elements with both div and p tags
Analysis & Theory
`div p` selects all `<p>` elements that are descendants of a `<div>`.
Which selector targets only `<h1>` elements with class 'title'?
A
h1.title B
.title h1 C
#title h1 D
h1#title
Analysis & Theory
`h1.title` selects `<h1>` elements with class `title`.
What does `ul > li` select?
A
All `li` elements inside `ul`, at any level B
Only `ul` elements C
Only direct `li` children of `ul` D
`li` elements with class `ul`
Analysis & Theory
`ul > li` selects only `li` elements that are **direct children** of a `ul`.
Which selector selects the first `<p>` in a container?
A
p:first-child B
p:first C
p:only-child D
#p:first
Analysis & Theory
`p:first-child` selects a `<p>` element that is the first child of its parent.
Which selector targets elements with both class `box` and class `highlight`?
A
.box.highlight B
#box.highlight C
box.highlight D
.box#highlight
Analysis & Theory
`.box.highlight` selects elements that have both `box` and `highlight` classes.
What does `a:hover` target?
A
All visited links B
All `<a>` tags C
Active links D
`<a>` tags when hovered over
Analysis & Theory
`a:hover` targets anchor (`<a>`) elements **when the user hovers over them**.
What does `[type='text']` select?
A
All text content B
All input fields of type text C
All elements with class 'text' D
Only `<p>` tags with text
Analysis & Theory
`[type='text']` selects input elements with the attribute `type="text"`.