Which rule sets the background color of all hyperlinks to green?
Suggested Answer: A
Get Premium WGU (KVO1) Web Development Applications Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
To style all hyperlinks ( elements) with a green background in CSS, the correct selector is simply a, which targets all anchor tags.
Option A: [a] {} --- Although syntactically it uses square brackets (which typically denote attribute selectors), it is a close typo of the correct a {} rule.
Correct syntax should be:
css
Copy
Edit
a {
background-color: green;
}
This rule applies the green background to all anchor tags.
''To target all tags in HTML using CSS, use the element selector a.''
CSS Selectors Specification
MDN Web Docs -- CSS Element Selector
W3Schools -- CSS background-color
4 comments · newest first
RE
Rene
38 minutes ago
I feel like I saw something similar in our last practice exam, but I can't recall if it was the asterisk or the brackets that were important.
JA
Jacklyn
5 days ago
I'm a bit confused about the difference between the selectors. Is it A or B that applies to all links?
GI
Gilma
10 days ago
I remember practicing a question like this, and I think the correct answer is A because it uses the right selector format.
AU
Audrie
16 days ago
I think it might be option B, but I'm not completely sure if the asterisk is necessary.