HTML Computer codeWhen we are programming, sometimes it is mandatory to show the Output result, error message, or coding part to user on a webpage. Hence to solve this issue HTML uses different tags for the user inputs, codes, programs, etc. With the help of these tags, you will be able to write codes to display on your webpage. Following is a list of some tags which are used in HTML for this task. - <code>
- <kbd>
- <samp>
- <var>
- <pre>
HTML <code> elementIt is used to represent some programming code on your website. The content written between tag will be displayed in default monospace font. Example: Test it Now
HTML <kbd> ElementIt is used to represent user input, keyboard input, voice command etc. Text written within <kbd>.....</kbd> tags is typically displayed in the browser's default monospace font. Example: Test it Now
HTML <samp> ElementThe HTML <samp> element is used to represent a program's output. Text written within samp element is typically displayed in the browser's default monospace font. Example: Test it Now
HTML <var> elementThe HTML <var> element is used to define a variable. The variable could be a variable in a mathematical expression or a variable in programming context. Example: Test it Now
HTML <pre> elementThe <pre> element defines preformatted text, which displays the content within it in a fixed-width font. It keeps the content into its original format and ignores all formatting. Example: Test it Now
|