Introduction to Programming Using HTML and CSS — Question 23

You are building a website and want to have three main links called Home, Product Info, and Contact Us. You will create a hierarchy of page elements and revise the stylesheets.
You want to apply a style to all elements in a document.
Which type selector should you use?

Answer options

Correct answer: D

Explanation

The correct answer is D, as the asterisk (*) is the universal selector in CSS that targets all elements within a document. Options A (+) and B (>) are combinators that select elements based on their relationship to one another, while option C (:) is a pseudo-class selector that applies styles based on the state of an element, none of which apply styles universally.