Marking up computer code

suggest change

Versions

code and pre date back through HTML 2.0, 3.2, 4.0, and HTML5.

Syntax

Remarks

The code element should be used for any kind of “string that a computer would recognize” (HTML5), for example:

Related elements

For variables, the var element can be used.

For computer output, the samp element can be used.

For user input, the kbd element can be used.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents