CSS HTML Validator - The fast, all-in-one, HTML, CSS, Link, SEO, spelling, and accessibility checker for Windows, & htmlval for Mac and Linux
Home Help: <code> element

The <code> Element

Inline Text Semantics

The <code> element represents a fragment of computer code, like an XML element name, a file name, a computer program, or any other text that a computer would recognize.

Attributes for <code>
TypeAttribute List
'Standard' Attributes(none)
New HTML5 Attributes"writingsuggestions"
Examples for "code"
DescriptionExample
How it rendersThis is how your browser renders "code" with our stylesheet (this text is in a <code> element).

Notes

  • There is no formal way to specify the language of the computer code being marked up, but the class attribute can be used to specify a class with a prefix of "language-", like class="language-cpp", class="language-html", class="language-javascript", class="language-pascal", etc.

Recommended Links

Search Engine Links (for more information)

Help us improve this page: Suggest a link or noteReport a problem