4.5.17 The samp element
4.5.17 The samp element
Категории:
потоковое содержимое.
Фразовое содержимое.
Palpable content.
Контексты, в которых может использоваться этот элемент:
Где ожидается Фразовое содержимое.
Контентная модель:
Фразовое содержимое.
Опущение тегов в text/html:
Ни один из тегов не может быть опущен.
Атрибуты контента:
глобальные атрибуты
Специфика доступности:
Для авторов.
Для разработчиков.
Санитизация:
Default.
DOM-интерфейс:
Uses HTMLElement.
The samp element represents sample or quoted output from another program or computing system.
See the pre and kbd elements for more details.
This element can be contrasted with the output element, which can be used to provide immediate output in a web application.
This example shows the samp element being used inline:
<p>The computer said <samp>Too much cheese in tray
two</samp> but I didn't know what that meant.</p>
This second example shows a block of sample output from a console program. Nested samp and kbd elements allow for the styling of specific elements of the sample output using a style sheet. There's also a few parts of the samp that are annotated with even more detailed markup, to enable very precise styling. To achieve this, span elements are used.
<pre><samp><span class="prompt">jdoe@mowmow:~$</span> <kbd>ssh demo.example.com</kbd>
Last login: Tue Apr 12 09:10:17 2005 from mowmow.example.com on pts/1
Linux demo 2.6.10-grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog-v6.189 #1 SMP Tue Feb 1 11:22:36 PST 2005 i686 unknown
<span class="prompt">jdoe@demo:~$</span> <span class="cursor">_</span></samp></pre>
This third example shows a block of input and its respective output. The example uses both code and samp elements.
<pre>
<code class="language-javascript">console.log(2.3 + 2.4)</code>
<samp>4.699999999999999</samp>
</pre>