Recall & Review
beginner
What is an element selector in CSS?
An element selector targets all HTML elements of a specific type to apply styles. For example,
p selects all paragraph elements.Click to reveal answer
beginner
How do you write a CSS rule to change the text color of all
h1 elements to blue?Use the element selector
h1 like this:<br>h1 {<br> color: blue;<br>}Click to reveal answer
beginner
True or False: Element selectors apply styles only to elements with a specific class.
False. Element selectors apply styles to all elements of that type, regardless of class or id.Click to reveal answer
beginner
What will this CSS do?<br>
div { background-color: lightgray; }It will set the background color of all
div elements on the page to light gray.Click to reveal answer
intermediate
Why should you be careful when using element selectors on large pages?
Because element selectors style every element of that type, they can affect many parts of the page and may cause unexpected changes if not used carefully.
Click to reveal answer
Which CSS selector targets all
p elements?✗ Incorrect
The element selector is just the element name, so
p selects all paragraph elements.What does this CSS rule do?<br>
h2 { font-weight: bold; }✗ Incorrect
The element selector
h2 targets all h2 tags and makes their text bold.If you want to style only one specific element, should you use an element selector?
✗ Incorrect
Element selectors apply styles to all elements of that type, not just one.
Which selector would you use to style all
button elements?✗ Incorrect
The element selector is simply the element name, so
button selects all button elements.What is a potential downside of using element selectors on a large website?
✗ Incorrect
Element selectors apply styles to every element of that type, which can cause unexpected changes if not used carefully.
Explain what an element selector is and give an example of how to use it in CSS.
Think about how you select all paragraphs or headings in CSS.
You got /3 concepts.
Describe a situation where using an element selector might cause problems on a webpage.
Consider what happens if you style all <code>div</code> or <code>p</code> elements without limits.
You got /3 concepts.