The coding elements indicate that the text inside <code>…</code> is a short part of the computer code.When you want to add programming code to your web page, you can use <code> element. By default, the content of the coding elements is displayed in default monospace font. Inside the code element, you can find a piece of a program in any programming language, an HTML or XML document, a set of CSS declarations, the contents of a configuration file, etc.
The <code> element does not preserve whitespace and linebreak, so to fix this you can put the <code> element inside a <pre> tag.
HTML <pre> Element:
The HTML <pre> element represents preformatted text which is to be presented exactly as written in the HTML file. Whitespace inside this element is displayed as written. The text is rendered using a non-proportional (“monospace”) font.
The <kbd> tag in HTML defines a keyboard input. It is used to identify text that represents user keyboard it means input text should be typed on a keyboard.
Text written inside <kbd> tags is displayed in the monospace font(all characters have the same width).
In HTML <samp> tag is an inline element and used to indicate sample output from a computer program or script. The content written inside <samp> tag is displayed in monospace format. It is used to display output from a process, such as an error message from a computer script.
The varibles in HTML are defined using <var> tag. The <var> tag is a phrase tag that is used to define the variable for a mathematical equation or in the programming context. The content written inside <var>…..</var> tag renders in the italic.