HTML computer code

Computer code refers to the way the computer internally represents letters or numbers.

In general, HTML uses variable letter sizes, as well as variable letter spacing.

This is not required when the computer code example is displayed.

Computer code element

label      description
<code>Defining computer code text
<kbd> Define keyboard text
<samp>Define computer code examples
<var>Defining variables
<pre>Defining preformatted text

The HTML <kbd> element defines keyboard input:

Instance


You can remove the <kbd> from the above code to see what is different.

The HTML <samp> element defines the computer output:

Instance


HTML <code> element definition programming:

The <code> element does not retain extra spaces and lines:


Program running result:

Code example
   Var person = { firstName:"Bill", lastName:"Gates", age:50, eyeColor:"blue" } 

HTML <pre> element
Instance



The HTML <var> element defines a mathematical variable:

Instance

Last Updated: 2018-07-06 12:32:44 By akshay

SHARE THIS

share_facebook share_twitter share_google_plus

Please Comment Here :