Which of the following is a correctly formatted CSS rule?

Study for the CodeHS Web Design (Picasso) Test. Prepare with flashcards and interactive multiple choice questions, each question supported by hints and explanations. Ace your exam!

The correctly formatted CSS rule among the options is indeed well-structured. In CSS, a rule consists of a selector and a declaration block. The selector identifies the HTML elements that the style will apply to, and the declaration block includes specific properties and their values enclosed in curly braces.

In this case, the selected element is "p," which targets paragraph elements. The declaration specifies the "color" property with a value of "red." This is a valid and commonly used way to apply color to text in paragraphs. The property and value are also separated by a colon and terminated with a semicolon, conforming to CSS syntax requirements.

The other options are also valid CSS rules, but they do not represent the chosen answer. Each option targets paragraph elements and uses valid properties and values, demonstrating correct syntax and formatting. Each would successfully affect the styling of the paragraph elements in different ways, just like the selected answer.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy