<code>

Summary

The HTML <code> Element represents a fragment of computer code. By default, it is displayed in the browser's default monospace font.

Attributes

This element only includes the global attributes.

Example

<p>Regular text. <code>This is code.</code> Regular text.</p>

Result

Regular text. This is code. Regular text.

Note

A CSS rule can be defined for the code selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.

Specifications

Specification Status Comment
HTML Living standard  
HTML5 Candidate Recommendation  
HTML 4.01 Specification Recommendation  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)

See also

HTML Elements
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
(Quick Links HTML Category)

Tags (3)

Contributors to this page: PablO, lmorchard, jswisher, FreakCERS, hobophobe, Qk9Ka7, ethertank, medicdude, Rappo, teoli, Ptak82, xaky, grendel, McGurk, Jscher2000
Last updated by: medicdude,
Last reviewed by: medicdude,