On this page
<code>
Prev: `<dl>` | Up: text | Next: `<time>`
Rel: text, Text & Lists Guide
Ref: MDN Web Docs — <code>
Tags: #public #web #html #elements #text #tier/core
Summary
Inline code fragment; wrap in <pre> for multi-line code blocks.
- Implicit ARIA Role:
code - DOM Interface:
HTMLElement - Key Attributes:
—
Notes & Best Practices
- Inline code spans: Wrap multi-line blocks in
<pre><code>...</code></pre>to preserve whitespace and line breaks.
Example
<p>Run <code>python3 -m pytest</code> to execute the suite.</p>
<pre><code>def add(a, b):
return a + b</code></pre>
Linked from
Related notes
- tuts/html/elements/text/dl Linked here; links to this page; shared tags: #elements, #html, #text, #tier, #web
- tuts/html/elements/text/time Linked here; links to this page; shared tags: #elements, #html, #text, #tier, #web
- tuts/html/elements/text Linked here; links to this page; shared tags: #elements, #html, #text, #web
- tuts/html/elements/text_and_lists Linked here; shared tags: #elements, #html, #web
- tuts/html/elements/text/a shared tags: #elements, #html, #text, #tier, #web
- tuts/html/elements/text/center shared tags: #elements, #html, #text, #tier, #web
- tuts/html/elements/text/div shared tags: #elements, #html, #text, #tier, #web
- tuts/html/elements/text/font shared tags: #elements, #html, #text, #tier, #web
- tuts/html/elements/text/h1 shared tags: #elements, #html, #text, #tier, #web
- tuts/html/elements/text/ol shared tags: #elements, #html, #text, #tier, #web