HTML Text Formatting - Part 2

Less frequently used HTML inline text semantic/formatting to define the meaning, structure, or style of a word, line, or any arbitrary piece of text.


<sub> Element

The html <sub> element specifies inline text which should be displayed as subscript.
Mostly used for writing mathematical formula, chemical compounds

        <p>log <sub>2</sub> 16 = x</p>

log2 16 = x

H2O




<ins> Element

The html <ins> represents a range of text that has been added to a document. Browsers will usually underline inserted text.

        <p>This is a <ins>inserted</ins> word text line.</p>

This is a inserted word text line.




<del> Element

The html <del> represents a range of text that has been deleted from a document. Browsers will usually strike a line through deleted text.

        <p>This is a <del>deleted</del> word text line.</p>

This is a deleted word text line.




<pre> Element

The html <pre> represents preformatted text which is to be presented exactly as written in the HTML file.

        <p>
        <pre>
            A  B  C  D  E
              E  G  H  I
               J  K  L
        </pre>
         </p>

A  B  C  D  E
  E  G  H  I
    J  K  L



<u> Element

The html <u> represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation..
Browsers will usually underline text.

        <p>This is a <u>underlined</u> word text line.</p>

This is a underlined word text line.




<abbr> Element

The html <abbr> represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation.

        <p>We are learning <abbr title="HyperText Markup language" >HTML</abbr> course.</p>

We are learning HTML course.




<cite> Element

The html <cite> is used to describe a reference to a cited creative work, and must include the title of that work.
Browsers usually display cite elements in italic.

        <p><cite>Romeo and Juliet</cite> is a tragedy written by William Shakespeare.</p>

Romeo and Juliet is a tragedy written by William Shakespeare.




<code> Element

The html <code> displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code.

        <p>The <code>push()</code> method adds one or more elements to the end of an array and returns the new length of the array.</p>

The push() method adds one or more elements to the end of an array and returns the new length of the array.




<kbd> Element

The html <kbd> represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device.

        <p>Please press <kbd>Ctrl</kbd> +  <kbd>T</kbd> to open new tab</p>

Please press Ctrl + T to open new tab