From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<TITLE>HTML 2.0 DTD: CODE element</TITLE>
</HEAD>
<BODY>
<H1>CODE</H1>
<p>
The &lt;CODE&gt; element indicates an example of code, typically
rendered in a mono-spaced font. The &lt;CODE&gt; element is intended for
short words or phrases of code; the
<a href="pre.html">&lt;PRE&gt;</a> block structuring
element is more appropriate
for multiple-line listings. For example:
</p>
<pre>
&lt;p&gt;The expression &lt;code&gt;x += 1&lt;/code&gt;
is short for &lt;code&gt;x = x + 1&lt;/code&gt;.
</pre>
<HR>
<H2>Content</H2>
<UL>
<LI>#PCDATA</LI>
<LI><A HREF="a.html"><STRONG>a</STRONG></A> -- Anchor; source and/or destination of a link
</LI>
<LI><A HREF="b.html"><STRONG>b</STRONG></A> -- Bold text
</LI>
<LI><A HREF="br.html"><STRONG>br</STRONG></A> -- Line break
</LI>
<LI><A HREF="cite.html"><STRONG>cite</STRONG></A> -- Name or title of cited work
</LI>
<LI><A HREF="code.html"><STRONG>code</STRONG></A> -- Source code phrase
</LI>
<LI><A HREF="em.html"><STRONG>em</STRONG></A> -- Emphasized phrase
</LI>
<LI><A HREF="i.html"><STRONG>i</STRONG></A> -- Italic text
</LI>
<LI><A HREF="img.html"><STRONG>img</STRONG></A> -- Image; icon, glyph or illustration
</LI>
<LI><A HREF="kbd.html"><STRONG>kbd</STRONG></A> -- Keyboard phrase, e.g. user input
</LI>
<LI><A HREF="samp.html"><STRONG>samp</STRONG></A> -- Sample text or characters
</LI>
<LI><A HREF="strong.html"><STRONG>strong</STRONG></A> -- Strong emphasis
</LI>
<LI><A HREF="tt.html"><STRONG>tt</STRONG></A> -- Typewriter text
</LI>
<LI><A HREF="var.html"><STRONG>var</STRONG></A> -- Variable phrase or substitutable
</LI>
</UL>
<HR>
<P>
<A HREF="code.attr.html"><STRONG>ATTRIBUTES</STRONG></A><BR>
<A HREF="code.cont.html"><STRONG>CONTENT DECLARATION</STRONG></A>
</P>
<DL>
<DT><STRONG>Tag Minimization</STRONG><DD>
Open Tag: <EM>REQUIRED</EM><BR>
Close Tag: <EM>REQUIRED</EM><BR>
</DL>
<HR>
<H2>Parent Elements</H2>
<UL COMPACT>
<LI><A HREF="a.html"><STRONG>a</STRONG></A> -- Anchor; source and/or destination of a link
</LI>
<LI><A HREF="address.html"><STRONG>address</STRONG></A> -- Address, signature, or byline for document or passage
</LI>
<LI><A HREF="b.html"><STRONG>b</STRONG></A> -- Bold text
</LI>
<LI><A HREF="blockquote.html"><STRONG>blockquote</STRONG></A> -- Quoted passage
</LI>
<LI><A HREF="body.html"><STRONG>body</STRONG></A> -- Document body
</LI>
<LI><A HREF="cite.html"><STRONG>cite</STRONG></A> -- Name or title of cited work
</LI>
<LI><A HREF="code.html"><STRONG>code</STRONG></A> -- Source code phrase
</LI>
<LI><A HREF="dd.html"><STRONG>dd</STRONG></A> -- Definition of term
</LI>
<LI><A HREF="dt.html"><STRONG>dt</STRONG></A> -- Term in definition list
</LI>
<LI><A HREF="em.html"><STRONG>em</STRONG></A> -- Emphasized phrase
</LI>
<LI><A HREF="form.html"><STRONG>form</STRONG></A> -- Fill-out or data-entry form
</LI>
<LI><A HREF="h1.html"><STRONG>h1</STRONG></A> -- Heading, level 1
</LI>
<LI><A HREF="h2.html"><STRONG>h2</STRONG></A> -- Heading, level 2
</LI>
<LI><A HREF="h3.html"><STRONG>h3</STRONG></A> -- Heading, level 3
</LI>
<LI><A HREF="h4.html"><STRONG>h4</STRONG></A> -- Heading, level 4
</LI>
<LI><A HREF="h5.html"><STRONG>h5</STRONG></A> -- Heading, level 5
</LI>
<LI><A HREF="h6.html"><STRONG>h6</STRONG></A> -- Heading, level 6
</LI>
<LI><A HREF="i.html"><STRONG>i</STRONG></A> -- Italic text
</LI>
<LI><A HREF="kbd.html"><STRONG>kbd</STRONG></A> -- Keyboard phrase, e.g. user input
</LI>
<LI><A HREF="li.html"><STRONG>li</STRONG></A> -- List item
</LI>
<LI><A HREF="p.html"><STRONG>p</STRONG></A> -- Paragraph
</LI>
<LI><A HREF="pre.html"><STRONG>pre</STRONG></A> -- Preformatted text
</LI>
<LI><A HREF="samp.html"><STRONG>samp</STRONG></A> -- Sample text or characters
</LI>
<LI><A HREF="strong.html"><STRONG>strong</STRONG></A> -- Strong emphasis
</LI>
<LI><A HREF="tt.html"><STRONG>tt</STRONG></A> -- Typewriter text
</LI>
<LI><A HREF="var.html"><STRONG>var</STRONG></A> -- Variable phrase or substitutable
</LI>
</UL>
<HR>
<P>
<A HREF="TOP-ELEM.html"><STRONG>Top Elements</STRONG></A>
<BR>
<A HREF="ALL-ELEM.html"><STRONG>All Elements</STRONG></A>
<BR>
<A HREF="ENTS.html"><STRONG>General Entities</STRONG></A><BR>
<A HREF="DTD-TREE.html#code"><STRONG>Tree</STRONG></A>
</P>
<HR>
<ADDRESS>
<A HREF="DTD-HOME.html">HTML 2.0 DTD</A>
</ADDRESS>
</BODY>
</HTML>