HTML Formatting
HTML provides us ability to format text without using CSS. HTML contains several elements for defining text with a special meaning.
HTML Formatting is a process of formatting text for better look and feel.There are almost 14 options available that how text appears in HTML.
Tags | Description |
---|---|
<b> | It is used to make text bold. |
<strong> | It tells the browser that the text is important. |
<i> | Used to make text italic. |
<u> | This tag is used to underline the text written between it. |
<em> | Used to display content in italic. |
<tt> | Used to appear a text in teletype. (not supported in HTML5) |
<sup> | It displays the content slightly above the normal line. |
<del> | Used to display the deleted content. |
<mark> | This tag is used to highlight text. |
<ins> | This tag displays the content which is added. |
<big> | Used to increase the font size by one conventional unit. |
<small> | Used to decrease the font size by one unit from base font size. |
<sub> | It displays the content slightly above the normal line. |
HTML bold text
HTML<b>
and <strong>
formatting elements are used to make text bold.
<p> <b>Here is Your First Paragraph in bold text.</b></p>
<p><strong>This is an strong content</strong>, and this is normal content</p>
Output:
HTML Italic text
HTML <i> and <em> formatting elements.
<p> <i>Here is Your First Paragraph in italic text.</i></p>
<p><em>This is an important content</em>, which displayed in italic font.</p>
Output:
HTML Underline
If you write anything within <u>
tag element, is shown in underlined text.
<p><u>This is the underline text</u></p>
Output:
HTML Monospaced Font
If you want that each letter has the same width then you can write your content within <tt>
………….</tt>
element. Monospaced Font provides similar space among every letter.
<p>Hello <tt><big>Write Your First Paragraph in monospaced font.</big></tt></p>
Output:
HTML Superscript Text
Superscript text appears half a character above the normal line.
HTML provides a provision to write your text as superscript. We generally used <sup>
tag in mathematical expressions to raise power.
<p>Here <sup>Your First Paragraph in superscript.</sup></p>
Output:
HTML Subscript Text
Subscript text appears half a character below the normal line.
<p>This is <sub>subscripted</sub> text.</p>
<p>H<sub>2</sub>O boosts skin health and beauty.<p>
Output:
HTML Deleted Text
The text within <del>
tag is displayed as deleted text.
<p>Here is the <del>deleted</del> text.<p>
Output:
HTML Highlighter
If you want to highlight or mark a text, you should write your content within <mark>
tag.
<p>Most of Engineers are <mark>Single</mark><p>
HTML Insert
If you want to add or insert some text then you should use <ins>
tag.
<p>Javatrainingschool provides <ins>Best content of</ins> HTML tutorials<p>
Output:
HTML Larger Text
Tag <big>
is used to increase the size of text. It increase one font size larger than the previous one.
<p>This is without big tag</p>
<p><big>This is with big tag</big></p>
Output:
HTML Smaller Text
Tag <small>
is used to make smaller the text. It reduces one font size than the previous one.
<p>This is without small tag</p>
<p><small>This is with small tag</small></p>
Output: