Code

Display code or preformatted text to the user.

Code

The <code> element displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code.

Lorem, ipsum dolor sit amet consectetur adipisicing elit.

Preformatted Text

The <pre> element represents preformatted text which is to be presented exactly as written in the HTML file. It is best used in conjuction with <code> to display source code snippets like the ones used throughout this site.

All HTML characters contained inside the code element should be encoded. You can use a free online tool do this for you.


<p>
  Lorem, ipsum dolor
  <code>sit amet consectetur</code>
  adipisicing elit.
</p>