Breaking News

Output Tags

These tags are often used to display computer/programming code. You might be surprised for “how to display the text containing the spaces, line breaks, programming codes, sample text, define variable”. Do not worry, because in this chapter we are going to show you how easily you can do easily.
So lets start with these tags:
Tag Description
<pre> Defines preformatted text
<code> Defines computer code text
<tt> Defines teletype text
<kbd> Defines keyboard text
<var> Defines a variable
<dfn> Defines a definition term
<bdo> Defines the direction of text display
<samp> Defines sample computer code
This is preformatted text. It preserves both spaces and line breaks. The pre tag is good for displaying computer code.
<pre> …..text…..</pre>
<pre> for i = 1 to 10
print i
next i
for i = 1 to 10
print i
next i
<code> …..text ……</code> Tag
This tag is also used to display the computer code. But better you use <pre> tag.
<code> …..text…..</code>
<kbd>…..Keyboard Input……</kbd> Tag
This tag displays the Keyboard Input.
<kbd> …….. Keyboard Input……</kbd>
<tt>……text….</tt> Tag
This tag displays the typewriter text.
<tt> …..text…..</tt>
<samp>….sample text…</samp> Tag
This tag displays the sample text.
<samp> …..sample text…..</samp>
<var> computer variable </var>
This tag defines the computer variable.
<var> computer variable </var>
<dfn> definition term </dfn>
this tag is used for definition term.
Examples of output tags
Examples Outputs
<pre> It preserve all spaces </pre> It preserve all spaces
<code>Computer code</code> Computer code
<kbd>Keyboard input</kbd> Keyboard input
<tt>Teletype text</tt> Teletype text
<samp>Sample text</samp> Sample text
<var>Computer variable</var> Computer variable
<dfn>Definition term</dfn> Definition term
Now you have learned the Output Tags so lets do some practical. Below there is a file type the same code on notepad (any text editor) and save it. now open this file in the internet browser.
<body> <code>Computer code</code>
<kbd>Keyboard input</kbd>
<tt>Teletype text</tt>
<samp>Sample text</samp>
<var>Computer variable</var>
These tags are often used to display computer/programming code.

Check Also


Attributes   Tags Attribute Value Description <table> align left,center,right Aligns the table. Deprecated. Use styles …