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

<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>

Try </>

code element

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

Example

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

Try </>

samp element

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

Example

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

Try </>

cite element

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

Example

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

Try </>

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.

pre element

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

Example

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

Try </>

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

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

Try </>

blockquote element

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

Example

<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>

Try </>

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

<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>

Try </>

bdo element

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

Example

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

Try </>

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

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

Try </>

Remove bdi to understand.

dfn element

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

Example

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>

Try </>


Was this article helpful?

 

Email:

Message:

Get the newsletter