nerdexam
CIW

1D0-510 · Question #62

Maria wants to use Cascading Style Sheets (CSS) to apply formatting styles to her Web pages. In her style sheet, she sets the page's background color to blue and the font to Arial. Which style rule…

The correct answer is C. body {background: blue; font-family: arial;}. See the full explanation below for the reasoning.

Question

Maria wants to use Cascading Style Sheets (CSS) to apply formatting styles to her Web pages. In her style sheet, she sets the page's background color to blue and the font to Arial. Which style rule is correct in an external style sheet?

Options

  • Abody {bgcolor: blue; font-type: arial}
  • Bstyle-body {background: blue; font: arial}
  • Cbody {background: blue; font-family: arial;}
  • D<style>body {bgcolor: blue; font-family: arial}>

How the community answered

(46 responses)
  • A
    2% (1)
  • B
    11% (5)
  • C
    80% (37)
  • D
    7% (3)

Community Discussion

6
Bao N.Bao N.May 14, 2026

C is the one, and the reasoning clicks fast once you know the actual CSS property names. The property for background color is "background" or "background-color", not "bgcolor" (that is an old HTML attribute, not CSS), and the property for specifying a typeface is "font-family", not "font-type" or "font". Option A gets both property names wrong, B invents a fake selector called "style-body" that means nothing in CSS, and D wraps the rule in an HTML style tag, which has no place inside an external stylesheet file. External stylesheets are pure CSS syntax, no HTML tags, so D is out immediately on that alone. C gives you a valid selector (body), correct property names, and proper semicolon-separated declarations inside curly braces, which is exactly how CSS is supposed to look.

17
Ingrid P.Ingrid P.Jun 2, 2026

Kept second-guessing A until I remembered bgcolor is HTML, not CSS, so C.

5
Mateus R.Mateus R.May 25, 2026

I kept eyeing A thinking bgcolor sounded right, but bgcolor is HTML not CSS, so C it is.

1
Viktor S.Viktor S.May 27, 2026

bgcolor being an HTML attribute was deprecated even before CSS took over the conversation, so C is right, but knowing *why* bgcolor died, which is separation of concerns, is what saves you when the question gets twisted.

0
Viktor S.Viktor S.Jun 10, 2026

A uses bgcolor and font-type, which is what HTML attributes taught us, so the logic carries over.

0
Bao N.Bao N.Jun 10, 2026

Viktor, bgcolor and font-type are not valid HTML attributes either, so that logic does not carry over. The correct answer is C because the valid HTML attributes for those purposes are bgcolor and face, as used on the font and body elements in older HTML.

0
Full 1D0-510 Practice