TK Study

Multiple choice › CSS (id v class)

CSS (id v class)

1. CSS (id v class)

index.html contains

Software includes code.

. main.css contains body {font-family: Arial;} h1 {font-weight: bold; text-align: center;} .qe_item {font-style: italic; font-weight: bold;}. The developer expected 'Software' to be bold and italic but it looks like regular text. Referring to the code, what is the cause of the problem?

  1. Font family is missing
  2. Attribute of has not been defined
  3. main.css has not been correctly referenced
  4. The id qe_item has not been correctly referenced
Answer

D

The HTML uses an id but the CSS selector .qe_item targets a CLASS (an id selector is #qe_item). Official flag: the NESA MG prints se_item vs qe_item in the question.