nerdexam
CIW

1D0-520 · Question #116

Which attribute should be used to assign inline styles to HTML?

The correct answer is B. style. See the full explanation below for the reasoning.

Question

Which attribute should be used to assign inline styles to HTML?

Options

  • Aid
  • Bstyle
  • Cvalue
  • Dclass

How the community answered

(38 responses)
  • A
    5% (2)
  • B
    74% (28)
  • C
    13% (5)
  • D
    8% (3)

Community Discussion

4
Nina C.Nina C.May 28, 2026

The answer is B, style. The style attribute is what lets you write CSS directly inside an HTML tag, so if you want to, say, turn text red right there on the element without touching a separate stylesheet, you write style="color: red;" and it applies just to that tag.

19
Mei-Ling H.Mei-Ling H.May 26, 2026

The answer is B, style. The style attribute is the one HTML gives you specifically for writing inline CSS declarations directly on an element, like style="color:red;font-size:14px;" and it takes a semicolon-separated list of property-value pairs. The other choices are easy to eliminate once you know what each attribute does: id and class are used for targeting elements with external or embedded CSS, not for writing the rules themselves, and value is for form elements like input to set a default value. Qualifier words did not really change this question, but watch for questions that ask about "best practice" versus "which attribute is valid" because inline styles are valid but external stylesheets are generally preferred for maintainability.

5
Brenda K.Brenda K.May 26, 2026

Style attribute, obviously, but do you know why id and class cannot apply inline styles directly?

-1
Nina C.Nina C.May 28, 2026

Right, and the way I think of it is that id and class are just labels the browser uses to match rules in a separate stylesheet, so without that external or internal CSS to actually pair with them, they carry no styling instructions on their own.

0
Full 1D0-520 Practice