Formatting elements were designed to display special types of text. Such as bold, italic, underline, highlighted text etc. HTML Formatting tags are used to format the appearance on the text on your page.
Formatting elements were designed to display special types of text. Such as bold, italic, underline, highlighted text etc. HTML Formatting tags are used to format the appearance on the text on your page. Formatting elements was designed to display special types of text. Different tags to make text appear differently. Text Formatting tags are as follows:
👉<b> - Bold Tag
Bold face any text between the tags. Make the text bold.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Bold tag </h2>
<p> Text that is usually <b>bold</b> </p>
</body>
</html>
👉<i> - Italic Tag
Italic face any text between the tags. Make the text italic.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Italic tag </h2>
<p> Text that is usually displayed as <i>italic</i> </p>
</body>
</html>
👉<u> - Underline Tag
Underlined any text between text. Not widely used, because most underline text on HTML pages is hyperlinks.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<u><h2> Underline tag </h2></u>
<p> Text that is usually displayed as underlined </p>
</body>
</html>
👉<small> - Small Tag
Sets a reduced font size for the enclosed text or display smaller text.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Small tag </h2>
<p> Text that displays as <small>small print</small> </p>
</body>
</html>
👉<strong> - Strong Tag
Signifies strongly emphasized content. Make the text strongly important with bold types.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Strong tag </h2>
<p> <strong> strongly important text </strong> </p>
</body>
</html>
👉<em> - Emphasized Tag
This tag indicates that the characters are emphasized in some way. Make the text stress emphasized with italic type.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Emphasized tag </h2>
<p> This is <em>emphasized text</em> </p>
</body>
</html>
👉<mark> - Mark Tag
Used for Highlighted text.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Mark tag </h2>
<p> This is <mark>highlighted text</mark> in this paragraph </p>
</body>
</html>
👉<strike> - Strike Tag
Used for strikethrough text.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Strike tag </h2>
<p> <strike> Strikethrough text goes here </strike> </p>
</body>
</html>
👉<del> - Delete Tag
Identifies deleted content. Marking text as editorial deletions.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Delete tag </h2>
<p> This is <del>deleted text</del> </p>
</body>
</html>
👉<code> - Code Tag
This tag indicates that the text inside is a code sample and displays it in a fixed-width font such as courier.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Code tag </h2>
<p> <code>#include "trans.h"</code> </p>
</body>
</html>
👉<sup> - Superscript Tag
Superscript any text between the tags. It is displayed half a character's height above the other characters.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Superscript tag </h2>
<p>
12<sup>th</sup><br>
4<sup>2</sup><br>
(a+b)<sup>2</sup> = a<sup>2</sup> + 2ab + b<sup>2</sup>
</p>
</body>
</html>
👉<sub> - Subscript Tag
Subscript any text between the tags. It is displayed half a character's below of the other characters.
Example:
<!DOCTYPE html>
<html>
<head>
<title> HTML Formatting Tags </title>
</head>
<body>
<h2> Subscript tag </h2>
<p>
H<sub>2</sub>O
H<sub>2</sub>SO<sub>4</sub>
</p>
</body>
</html>