HTML Computer Code Elements

HTML Computer Code Elements

HTML <code> Element

<code>
#include <stdio.h> 
int main(){ 
printf("Hello World"); 
}
</code>
HTML code Element

Code Element

C

#include int main(){ printf("Hello World"); }
html
<!DOCTYPE html>
<html>
<head>
<title>HTML code Element</title>
</head>
<body>

<h3>Code Element</h3>

<h4>C</h4>
<code>
#include <stdio.h> 
int main(){ 
 printf("Hello World"); 
}
</code>

</body>
</html>

HTML <kbd> Element

<p>Save the document by pressing <kbd>Ctrl + S</kbd></p>
<p>Copy the document by pressing <kbd>Ctrl + C</kbd></p>
<p>Cut the document by pressing <kbd>Ctrl + X</kbd></p>
<p>Undo the document by pressing <kbd>Ctrl + Z</kbd></p>
HTML kbd Element

Example of kbd Element

Use the following shortcut keys

Save the document by pressing Ctrl + S

Copy the document by pressing Ctrl + C

Cut the document by pressing Ctrl + X

Undo the document by pressing Ctrl + Z

html
<!DOCTYPE html>
<html>
<head>
<title>HTML kbd Element</title>
</head>
<body>

<h3>Example of kbd Element</h3>

<p>Use the following shortcut keys</p>

<p>Save the document by pressing <kbd>Ctrl + S</kbd></p>
<p>Copy the document by pressing <kbd>Ctrl + C</kbd></p>
<p>Cut the document by pressing <kbd>Ctrl + X</kbd></p>
<p>Undo the document by pressing <kbd>Ctrl + Z</kbd></p>

</body>
</html>

HTML <samp> Element

<p>I was trying to boot my computer, but I got this hilarious message:</p>
<p><samp>Keyboard not found <br/>Press F1 to continue</samp></p>
HTML samp Element

The samp Element

I was trying to boot my computer, but I got this hilarious message:

Keyboard not found
Press F1 to continue

html
<!DOCTYPE html>
<html>
<head>
<title>HTML samp Element</title>
</head>
<body>

<h3>The samp Element</h3>

<p>I was trying to boot my computer, but I got this hilarious message:</p>
<p>
  <samp>Keyboard not found <br/>Press F1 to continue</samp>
</p>

</body>
</html>

HTML <var> Element

<p>
The volume of a box is <var>l</var> × <var>w</var> × <var>h</var>, where
<var>l</var> represents the length, <var>w</var> the width and
<var>h</var> the height of the box.
</p>
HTML var Element

The var Element

The volume of a box is l × w × h, where l represents the length, w the width and h the height of the box.

html
<!DOCTYPE html>
<html>

<head>
<title>HTML var Element</title>
</head>

<body>

<h3>The var Element</h3>

<p>
The volume of a box is <var>l</var> × <var>w</var> × <var>h</var>, where
<var>l</var> represents the length, <var>w</var> the width and
<var>h</var> the height of the box.
</p>

</body>
</html>

HTML <pre> Element

<pre><code>
body {
color: blue;
}
</code></pre>
HTML pre Element HTML pre Element

body {
  color: blue;
}
html
<!DOCTYPE html>
<html>

<head>
<title>HTML pre Element</title>
</head>

<body>

<title>HTML pre Element</title>

<pre><code>
body {
  color: blue;
}
</code></pre>
  

</body>
</html>