Formatting Elements in HTML
Formatting Elements in HTML
In this article, I am going to discuss Formatting Elements in HTML with Examples. Please read our previous article where we discussed
Classes and Ids in HTML with Examples. At the end of this article, you will learn everything about HTML Formatting Elements with
Examples.
HTML Formatting is a process of formatting text for a better look and feel. HTML provides us the ability to format text without using CSS. There
are many formatting tags in HTML. These tags are used to make text bold, italicized, or underlined, etc.
In Html, there are many tags that are useful to highlight text with special meaning. These tags are known as formatting tags. There is a total of 10
formatting tags in Html. Formatting tags are designed to highlight special types of text.
The <b> tag is used to make the text bold. The <strong> tag is used to make the text bold and give extra importance to the text. The text inside
the strong tag is considered as important.
<p> This text is normal.</p> <p> <b>This text is bold.</b> </p> <p> <strong>This text is very important!</strong> </p>
Output: When you run the above code, you will get the following output in the browser.
<p> To learn HTML visit <b> Dot Net Tutorial </b> </p>
<p> To learn HTML visit <strong> Dot Net Tutorial </strong> </p>
<p> To learn HTML visit <b> Dot Net Tutorial </b> </p> <p> To learn HTML visit <strong> Dot Net Tutorial </strong> </p>
<p> To learn HTML visit <b> Dot Net Tutorial </b> </p>
<p> To learn HTML visit <strong> Dot Net Tutorial </strong> </p>
Output: When you run the above code, you will get the following output in the browser.
The HTML <i> and <em> Formatting Element
In Html, <i> and <em> elements are used to italicize a text. Both <i> and <em> have the same functionality.
Output: When you run the above code, you will get the following output in the browser.
The HTML <u> Element
The underline tag is used to add underline to the text enclosed inside it.
Output:
Output:
The <del> element in HTML is used to display the element that has been deleted. It will strikethrough the deleted element to show that it has
been removed.
The <ins> element in HTML is used to indicate the text that has been inserted into the document. Inserted items are denoted by an underline.
Output:
The HTML <sub> Formatting Element
In Html, the <sub> element is used to define subscript text. The subscript text normally appears half a character lower than the regular line.
<p>H<sub>2</sub>O, CH<sub>4</sub></p>
Output:
The HTML <sup> Formatting Element
In Html, the <sup> element is used to define superscript text. The superscript text normally appears half a character higher than the regular line.
Output:
The HTML <tt> Formatting Element
The content of a <tt>…</tt> element is written in monospaced font. Most of the fonts are known as variable-width fonts because different letters
are of different widths (for example, the letter ‘m’ is wider than the letter ‘i’). In a monospaced font, however, each letter has the same width.
Output:
The HTML <big> Formatting Element
The content of the <big>…</big> element is displayed one font size larger than the rest of the text surrounding.
Output:
In the next article, I am going to discuss Quotations in HTML with Examples. Here, in this article, I try to explain Formatting Elements in
HTML with Examples and I hope you enjoy this HTML Formatting Elements with Examples article.
Pranaya Rout has published more than 3,000 articles in his 11-year career. Pranaya Rout has very good experience with Microsoft Technologies,
Including C#, VB, ASP.NET MVC, ASP.NET Web API, EF, EF Core, ADO.NET, LINQ, SQL Server, MYSQL, Oracle, ASP.NET Core, Cloud
Computing, Microservices, Design Patterns and still learning new technologies.