67.1k views
4 votes
Which line defines a valid CSS formatting rule?

A) color(p) = "black";
B) p#color:black;
C) p:color="black";
D) p {color:black;}
E) {p} color:black;

1 Answer

4 votes

Final answer:

The correct line for a valid CSS formatting rule is 'p {color:black;}', representing the correct syntax in CSS for setting the text color of paragraph elements.

Step-by-step explanation:

The line that defines a valid CSS formatting rule is D) p {color:black;}. This is the correct syntax for setting the text color of a paragraph element to black in CSS (Cascading Style Sheets). The general format for a CSS rule is selector {property:value;}, where the selector is the HTML element you want to style, the property is the attribute you want to change, and the value is the new style attribute you want to apply.

User Epsilonhalbe
by
8.3k points