Which of the following selects all p tags with the class alert and makes them red?

Prepare for your CodeHS Web Design (Picasso) Test with quizzes and multiple-choice questions designed to enhance your understanding. Gain confidence with hints and explanations for each question to excel in your exam!

Multiple Choice

Which of the following selects all p tags with the class alert and makes them red?

Explanation:
The selection of p tags with the class "alert" and changing their color to red is accurately achieved by the correct answer. When using CSS, the syntax for targeting specific HTML elements based on their classes requires the element type followed by a period and the class name. In this case, "p.alert" correctly identifies all paragraph tags (p) that are assigned the class "alert." The declaration "{ color: red; }" specifies that the text color of those selected elements should be red, which is exactly what the question asks for. Other choices either incorrectly refer to a class that does not match what we are looking for or specify a different color than red, thus failing to meet the requirements of the question.

The selection of p tags with the class "alert" and changing their color to red is accurately achieved by the correct answer. When using CSS, the syntax for targeting specific HTML elements based on their classes requires the element type followed by a period and the class name. In this case, "p.alert" correctly identifies all paragraph tags (p) that are assigned the class "alert." The declaration "{ color: red; }" specifies that the text color of those selected elements should be red, which is exactly what the question asks for.

Other choices either incorrectly refer to a class that does not match what we are looking for or specify a different color than red, thus failing to meet the requirements of the question.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy