--- title: '<code>: O Elemento Inline Code' slug: Web/HTML/Element/code translation_of: Web/HTML/Element/code --- <div>{{HTMLRef}}</div> <p id="Summary"><span class="seoSummary">O <strong>elemento</strong> <strong>HTML <code><code></code> </strong>apresenta seu conteúdo estilizado de maneira a indicar que o texto é um pequeno fragmento de código. Por padrão</span>, o conteúdo é exibido utilizando a fonte monoespaçada padrão do {{Glossary("user agent", "user agent's")}}.</p> <div>{{EmbedInteractiveExample("pages/tabbed/code.html", "tabbed-shorter")}}</div> <table class="properties"> <tbody> <tr> <th scope="row"><a href="/en-US/docs/Web/HTML/Content_categories">Content categories</a></th> <td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Flow content</a>, <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content">phrasing content</a>, palpable content.</td> </tr> <tr> <th scope="row">Permitted content</th> <td><a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content">Phrasing content</a>.</td> </tr> <tr> <th scope="row">Tag omission</th> <td>{{no_tag_omission}}</td> </tr> <tr> <th scope="row">Permitted parents</th> <td>Any element that accepts <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content">phrasing content</a>.</td> </tr> <tr> <th scope="row">Permitted ARIA roles</th> <td>Any</td> </tr> <tr> <th scope="row">DOM interface</th> <td>{{domxref("HTMLElement")}} Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the {{domxref("HTMLSpanElement")}} interface for this element.</td> </tr> </tbody> </table> <h2 id="Atributos">Atributos</h2> <p>Esse elemento inclui apenas os <a href="/pt-BR/docs/Web/HTML/Global_attributes" title="HTML/Atributos Globais">global attributes</a>.</p> <h2 id="Exemplo">Exemplo</h2> <p>Um parágrafo que inlcui <code><code></code>:</p> <pre class="brush: html"><p>A função <code>selectAll()</code> destaca todo o texto no campo de entrada então o usuário pode, por exemplo, copiar ou deletar o texto.</p> </pre> <p>A sainda gerada por esse trecho HTML se parece com isso:</p> <p>{{EmbedLiveSample("Example", 640, 70)}}</p> <h2 id="Notas">Notas</h2> <p>Para representar múltiplas linha de código, envolva o elemento <code><code></code> dentro do elemento {{HTMLElement("pre")}}. O elemento <code><code></code> por si só representa somente uma única senteça ou linha de código.</p> <p>Uma regra CSS pode ser definida para o seletor <code>code</code> para sobrescrever a fonte padrão do navegador. Preferências definidas pelo usuário podem ter precedência sore o CSS especifciado.</p> <h2 id="Especificações">Especificações</h2> <table class="standard-table"> <thead> <tr> <th scope="col">Especificação</th> <th scope="col">Status</th> <th scope="col">Comentário</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('HTML WHATWG', 'semantics.html#the-code-element', '<code>')}}</td> <td>{{Spec2('HTML WHATWG')}}</td> <td></td> </tr> <tr> <td>{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-code-element', '<code>')}}</td> <td>{{Spec2('HTML5 W3C')}}</td> <td></td> </tr> <tr> <td>{{SpecName('HTML4.01', 'struct/text.html#h-9.2.1', '<code>')}}</td> <td>{{Spec2('HTML4.01')}}</td> <td></td> </tr> </tbody> </table> <h2 id="Browser_compatibility">Compatibilidade com navegadores</h2> <p>{{Compat("html.elements.code")}}</p> <h2 id="Veja_também">Veja também</h2> <ul> <li>{{HTMLElement("samp")}}</li> <li>{{HTMLElement("kbd")}}</li> <li>{{HTMLElement("command")}} (deprecated)</li> <li>{{HTMLElement("var")}}</li> <li>{{HTMLElement("pre")}}</li> </ul>