<samp>

  • Revision slug: HTML/Element/samp
  • Revision title: samp
  • Revision id: 22476
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment no changes

Revision Content

The HTML Sample Text Element (<samp>) produces an inline element displayed in the browser's default monotype font (Lucida Console). This element was intended to identify sample output from a computer program.

DOM Interface

This element implements the HTMLElement interface.

Implementation note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element.

Example

   Regular text. <samp>This is sample text.</samp> Regular text.

Result

Regular text. <samp>This is sample text.</samp> Regular text.

(This example appears not to work due to restrictions in the wiki software, but in real web pages it should be fine!)

Note

A CSS rule can be defined for the samp selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.

See also

{{ HTML:Element_Navigation() }}

{{ languages( { "pl": "pl/HTML/Element/samp" } ) }}

Revision Source

<p>The HTML Sample Text Element (<span style="font-family: Courier New;">&lt;samp&gt;</span>) produces an inline element displayed in the browser's default monotype font (Lucida Console). This element was intended to identify sample output from a computer program.</p>
<h3 class="editable">DOM Interface</h3>
<p>This element implements the <code><a href="/en/DOM/element" title="en/DOM/element">HTMLElement</a></code> interface.</p>
<div class="note">
<p><strong>Implementation note: </strong>up to Gecko 1.9.2 inclusive, Firefox implements the <a href="/en/DOM/span" title="en/DOM/span"><span style="font-family: Courier New;">HTMLSpanElement</span></a> interface for this element.</p>
</div>
<h3 name="Example">Example</h3>
<pre class="eval">   Regular text. &lt;samp&gt;This is sample text.&lt;/samp&gt; Regular text.
</pre>
<h4 name="Result">Result</h4>
<p>Regular text. &lt;samp&gt;This is sample text.&lt;/samp&gt; Regular text.</p>
<p>(This example appears not to work due to restrictions in the wiki software, but in real web pages it should be fine!)</p>
<h3 name="Note">Note</h3>
<p>A CSS rule can be defined for the <code>samp</code> selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.</p>
<h3 name="See_also">See also</h3>
<ul> <li><a href="/en/HTML/Element/code" title="en/HTML/Element/code">HTML Code Element</a></li> <li>HTML 4.01 Specification: <a class="external" href="http://www.w3.org/TR/html4/struct/text.html#h-9.2.1">Phrase Elements</a></li>
</ul>
<p>{{ HTML:Element_Navigation() }}</p>
<p>{{ languages( { "pl": "pl/HTML/Element/samp" } ) }}</p>
Revert to this revision