To add a background color to all <h1> elements, which CSS syntax is used?
2015
To add a background color to all <h1> elements, which CSS syntax is used?
Answer: A. h1 { background-color: #FFFFFF; } — Key idea: Use the CSS selector h1 followed by a declaration block. Correct syntax: h1 { background-color: #FFFFFF; } The semicolon after the declaration is…
- A.
h1 { background-color: #FFFFFF; }
- B.
{ background-color :#FFFFFF} . h1
- C.
h1 { background-color :#FFFFFF} . h1(all)
- D.
h1. all{bgcolor= #FFFFFF}
Attempted by 393 students.
Show answer & explanation
Correct answer: A
Key idea: Use the CSS selector h1 followed by a declaration block.
Correct syntax: h1 { background-color: #FFFFFF; }
The semicolon after the declaration is the standard complete CSS form; browsers may tolerate its omission only when it is the last declaration.
Final answer: Option A