# HTML Computer Code Elements
● HTML Computer Code Formatting
HTML normally uses variable letter size and spacing.
This is not what we want when displaying computer code.
The <kbd>,<samp>, and <code> elements are all displayed in fixed letter size and spacing.
This is not what we want when displaying computer code.
The <kbd>,<samp>, and <code> elements are all displayed in fixed letter size and spacing.
● HTML <kbd> For Keyboard Input
The HTML <kbd> element defines keyboard input.
● HTML <samp> For Computer Output
The HTML <samp> element defines sample output from a computer program.
● HTML <code> For Computer Code
The HTML <code> element defines a piece of programming code.
Notice that the <code> element does not preserve extra whitespace and line-breaks.
To fix this, Putting the <code> element inside a <pre> element.
Notice that the <code> element does not preserve extra whitespace and line-breaks.
To fix this, Putting the <code> element inside a <pre> element.
● HTML <var> For Variables
The HTML <var> element defines a variable.
The variable could be a variable in a mathematical expression or a variable in programming context.
The variable could be a variable in a mathematical expression or a variable in programming context.
● HTML Computer Code Elements
https://www.w3schools.com/html/html_computercode_elements.asp |
No comments:
Post a Comment