CBSE Class 10 Computer Applications Question 26 of 56

Cascading Style Sheets (CSS) — Question 7

Back to all questions
7
Question

Question 7

Which one of the following is a correct statement?

  1. h1 {font-weight:bold; font-family:Arial;color:red}
  2. h1 {font weight; bold; fontfamily: Arial; color: red}
  3. h1 {font-weight; bold; font-family;Arial;color;red
  4. None of these
Answer

h1 {font-weight:bold; font-family:Arial;color:red}

Reason — This above statement specifies that the text within <h1> elements should have a bold font-weight, use the Arial font family, and have red text color. The format with a colon (:) is used to assign property-value pairs in CSS. Options 2 and 3 have incorrect syntax with missing colons and semicolons, making them invalid CSS statements. Option 4 is not applicable because option 1 is the correct statement.