Web4College

HTML Codes

HTML codes represent the text in different forms for the special purposes. It includes the formatting of keyboard input, sample text, abbreviated text etc.

Kbd element

kbd element defines the keyboard input. It formats the text as was echoed by the system.

Example
Try it
<p>To copy the text press <kbd>Ctrl</kbd>+<kbd>c</kbd></p>
<p>To paste the text press <kbd>Ctrl</kbd>+<kbd>v</kbd>.</p>

code element

code element represents the text in the coded form. It represents a piece of computer code.

Example
Try it
<pre><code>
  var x=5;
 function cube(x){
 document.write(x*x*x);
 }
 cube(5);
 </code></pre>

samp element

samp element defines the sample output from the system or program.

Example
Try it
<p><samp>Here the output of some program is written.</samp></p>

cite element

cite element is used to represent the title (book, song) or name (person, organization) of some creative work.

Example
Try it
<cite>To Kill a Mockingbird</cite> novel was written by <cite>Harper Lee</cite>

address element

address element is used to represent the contact information of an author of a website. It may also be used to define the address.

Example
Try it
<address>
 <p>For more details, contact</p>
 <a href="mailto:a@example.com">Andrea</a>.
</address>

pre element

pre element is used to preserve the spaces. This preserves the original formatting of text.

Example
Try it
<pre>
  Here the text preserves
  the    space and 
  formatting. formatting includes 
  style etc.
</pre>

You can see in the above example that this tag preserves the spaces between the words. And if we write this paragraph inside the <p> tag, then it does not preserve text. It used in writing poems, address etc.

q element

q element applies quotes on the quotations.

Example
Try it
<p>William Shakespeare says, <q>It is not in the stars to hold our destiny but in ourselves.</q>

blockquote element

blockquote element defines the content that is quoted from the original source.

Example
Try it
<blockquote cite="http://www.who.int/topics/human_rights/en/">
The WHO Constitution was the first international instrument to enshrine the enjoyment of the highest attainable standard of health as a fundamental right of every human being ("the right to health").
</blockquote>

abbr element

abbr means abbreviation. This element contains the abbreviated form of some term as content. The expanded form of the abbreviated term is written in the title attribute.

Example
Try it
<p><abbr title="world wilderness congress">WWC</abbr> is an ongoing conservation project, focused on practical outcomes in policy, new wilderness areas, trainings for communities and professionals.</p>

bdo element

bdo stands for 'bi-directional override'. It changes the direction of language using dir attribute.

Example
Try it
<bdo>You should concentrate on the examples to understand thoroughly.</bdo>
<bdo dir="rtl">You should concentrate on the examples to understand thoroughly.</bdo>

rtl means 'right to left'. ltr means 'left to right'.

bdi element

bdi stands for 'bi-direction isolation'. It is useful when two languages are used at a time. For example, if the Arabic language is used in the English language. This element isolates one language from another language to avoid directionality problems.

Example
Try it
 <li>writer john: 3 articles.</li>
 <li>writer chris: 5 articles.</li>
 <li>writer <bdi>إيان</bdi>: 4 articles</li>

Remove bdi to understand.

dfn element

dfn element defines the defining instance of a term. It refers the term to its definition.

Example
Try it
The <dfn id="ww"> WWW </dfn> is an information space where documents are identified by Uniform Resource Locators (URLs), interlinked by hypertext links, and can be accessed via the Internet.


<p>The <a href="#ww">WWW</a> has been playing role in the development of the information age and is the primary tool billions of people use to interact on the Internet.</p>