1. Home
  2. Computer Science MCQs
  3. HTML
  4. Which HTML element is used to define computer code text?

Added 10 Feb 2024

Which HTML element is used to define computer code text?

  1. <code> Correct answer
  2. <pre>
  3. <var>
  4. <kbd>

Correct answer

A. <code>

17 views

MCQSEXAM

Explanation

The correct answer is <code>. The <code> tag is used to define computer code text in HTML, indicating that the content represents a fragment of code. Browsers typically render code text with a monospace font. Using semantic HTML elements like <code> improves the structure and accessibility of web content, particularly for displaying code snippets and examples.

Reference

https://www.w3schools.com/html/html_formatting.asp

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