Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

code

The <code> element is used to markup code for display. Wrap the <pre> element around it to preserve white space and new lines if the code you are displaying has multiple lines.

Code Example

<pre><code>&lt;script&gt; var a = 4; var b = 2; var c = a + b; &lt;/script&gt;</code></pre> open in code editor

Attributes

globals - the global attributes common to all elements possible values: see global attribute list

Official Documentation

http://www.w3.org/TR/html/text-level-semantics.html#the-code-element

HTML

Elements

aabbraddressareaasidearticleaudiobbasebdobdiblockquotebodybrbuttoncanvascaptioncitecodecolcolgroupdatadatalistdddeldetailsdfndialogdivdldtemembedfieldsetfigcaptionfigurefooterformh1 h2 h3 h4 h5 h6headheaderhrhtmliiframeimginputinskbdkeygenlabellegendlilinkmainmapmarkmetameternavnoscriptobjectoloptgroupoptionoutputpparampreprogressqrb rp rt rtc rubyssampscriptsectionselectsmallsourcespanstrongstylesub supsummarytabletbodytdtemplatetextareatfootththeadtimetitletrtrackuulvarvideowbr