Which HTML attribute is used to define inline styles?

  1. font

  2. styles

  3. style

  4. class


Correct Option: C

AI Explanation

To answer this question, let's go through each option:

Option A) font - This option is incorrect because the "font" attribute is not used to define inline styles in HTML. The "font" attribute is used to specify the font face, size, and color of text within an HTML element.

Option B) styles - This option is incorrect because the "styles" attribute is not used to define inline styles in HTML. There is no attribute called "styles" in HTML.

Option C) style - This option is correct. The "style" attribute is used to define inline styles in HTML. It is added to an HTML element and allows you to specify CSS properties and values directly within the element's opening tag.

Option D) class - This option is incorrect because the "class" attribute is used to define class names in HTML, not inline styles. The "class" attribute is used to group elements together and apply styles using CSS.

The correct answer is C) style. This option is correct because the "style" attribute is used to define inline styles in HTML.

Find more quizzes: