1. Home
  2. Computer Science MCQs
  3. HTML
  4. Which attribute is used to define inline styles in HTML?

Added 20 Jan 2024

Which attribute is used to define inline styles in HTML?

  1. style Correct answer
  2. css
  3. design
  4. format

Correct answer

A. style

13 views

MCQSEXAM

Explanation

The style attribute defines inline styles, applying CSS directly to one element: <p style="color:red;">.

Inline styles have the highest specificity, so they override rules in internal and external style sheets. They are best kept for quick tests; external CSS is easier to maintain.

Want more practice? Try the full set of Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More HTML MCQs

Practise all HTML MCQs

Similar MCQs