From MDN, <samp>
The HTML
<samp>
element is an element intended to identify sample output from a computer program. It is usually displayed in the browser's default monotype font (such as Lucida Console).
This is of course very useful on all the "code" sites, but particularly also in documentation. Can we have a decent CSS style for it?
Usage example:
The following should appear on your screen:
<samp>sklivvz@DESKTOP-FP94G5S:~$ uname -r
3.4.0+</samp>
Expected output should look like a terminal or at least be <pre>
:
The sample should appear on your screen:
Actual output does not even conform to expected HTML5 behavior:
The following should appear on your screen:
sklivvz@DESKTOP-FP94G5S:~$ uname -r 3.4.0+
<samp>
would still be nice). I vaguely recall discussing something like this a couple years back, primarily for logcat listings.<samp>
. One step at a time. Let's see if we can get 2 hours of a designer to implement a style on a minor HTML5 tag first.<pre>
", why would you expect that? The default browser style for <samp> is only the monospace font, nothing else.<p>
tags instead of<samp>
. However, I would really like to see this feature for console output, logs, probably even error messages.samp
would render something like this codepen.io/anon/pen/rmQqPX