Skip to content Skip to main navigation Report an accessibility issue

Code and Pre

Documentation

Usage: When showing computer code inline (mid-sentence), indicate it by wraping that code in the <code> element. Blocks of code or pre-formatted text should be wrapped in <pre>.

EXAMPLE

For example, <section> should be wrapped as inline.

  
<?php
function Smokey($says)
{
    echo "Woof woof!";
}
?>

Code

HTML
<p>For example, <code>&lt;section&gt;</code> should be wrapped as inline.</p>

<pre>
  
&lt;?php
function Smokey($says)
{
    echo &quot;Woof woof!&quot;;
}
?&gt;

</pre>