HTML Computer Code Formatting
HTML normally uses variable letter size and spacing. This is not wanted when displaying examples of computer code. The
<kbd>,
<samp>,
and
<code>
elements all support fixed letter size and spacing.
Computer Code Element
<code> var x = 5; var y = 6; document.getElementById("demo").innerHTML = x + y;</code> HTML Computer Code Elements Tag Description <code> Defines programming code <kbd> Defines keyboard input <samp> Defines computer output <var> Defines a variable <pre> Defines preformatted text

html5