HTML Text Formatting

HTML texts can be formatted using specific HTML elements like <b> and <i> to make the text bold or italic. Some of the elements have special meaning while some are for plain stylings only.

These text formatting elements are displayed in the table below.

HTML Element Example Result Meaning
<b> <b>Bold</b> Bold Plain Bold text
<strong> <strong>Strong</strong> Strong Bold text with high importance
<i> <i>Italics</i> Italics Plain Italic text
<em> <em>Emphasized</em> Emphasized Italic text with high importance
<u> <u>Underlined</u> Underlined Underlined text
<mark> <mark>Mark</mark> Mark Highlighted text
<small> <small>Small</small> Small Smaller text
<del> <del>Del</del> Del Deleted text
<ins> <ins>Inserted</ins> Inserted Inserted text
<sup> x<sup>2</sup> x2 Superscript text
<sub> H<sub>2</sub>O H2O Subscript text

HTML <q> Element

The HTML <q> element is used for short quotation. Browsers display contents inside a <q> element within quotation marks

Webtrickshome's goal is to: <q>Help beginners learn web design and development easier and faster.</q>

Result:

Webtrickshome's goal is to: Help beginners learn web design and development easier and faster.

HTML <blockquote> Element

The HTML <blockquote> element defines a content that is quoted from another source. Browsers indent <blockquote> elements.

Here's a quote from Magical Trekkers.

<blockquote cite="https://www.magicaltrekkers.com/travel-for-a-cause">
At Magical Trekkers, we firmly believe that humanity begins at home which is why we donate a 
part of our earnings to improve the medical, educational and environmental status of Nepal.
</blockquote>

Result:

At Magical Trekkers, we firmly believe that humanity begins at home which is why we donate a part of our earnings to improve the medical, educational and environmental status of Nepal.

HTML <abbr> Element

The HTML <abbr> element defines an abbreviation or an acronym. Marking abbreviations can give useful information to browsers, translation systems and search-engines while enhancing readability of any article. <abbr> is generally followed by the title attribute where the full form of the content is placed.

<abbr title="United Nations High Commissioner for Refugees">UNHCR</abbr> was founded in December 14, 1950.	

Result:

UNHCR was founded in December 14, 1950.

HTML <cite> Element

The HTML <cite> element defines the title of a work. Browsers display <cite> elements in italic.

<cite>Self-portrait, The Desperate Man</cite> by Gustave Courbet.

HTML <bdo> Element

The HTML <bdo> element defines bi-directional override. It is used to override the current text direction

<bdo dir="rtl">This text will be written from right to left</bdo>

HTML Comments

Comment tags are used in HTML to insert comments in the HTML source code. These comments are not displayed in the browser but are highly useful to keep the source code properly documented. Comments can be used to add notices or reminders in a HTML file. Comments can be useful on debugging HTML by commenting blocks of HTML codes and locate the errors.

Syntax

<!-- Write your comments here -->


0 Like 0 Dislike 0 Comment Share

Leave a comment