When you write content, you need some text to look more special than other text like bold, italic, underlining, and so on. This element for defining text with special meaning is HTML formatting.
HTML Formatting Elements:
Below are the list of HTML formatting elements:
- <b> – Bold Text
- <i> – Italic Text
- <strong> – Important Text
- <u> – Underline Text
- <em> – Emphasized Text
- <mark> – Marked Text
- <small> – Smaller Text
- <big> – Larger Text
- <del> – Deleted Text
- <ins> – Inserted Text
- <sub> – Subscript Text
- <sup> – Superscript Text
- <strike> – Strike Text
- <tt> – Monospaced Font
1) <b> – Bold Text
The <b> element has opening and closing tag. <b> … </b>. Any texts that appears between opening <b> tag and closing </b> tag is shown in bold texts.
Syntax:
<b> ... </b>
Code:
<!DOCTYPE html>
<html>
<head>
<title>Bold Text</title>
</head>
<body>
<p> This is a first line without using bold element. </p>
<br/>
<p>
This is a <b>second line</b> with using <b>bold element.</b>
</p>
</body>
</html>
Output:
2) <i> – Italic Text
The <i> element has opening and closing tag. <i> … </i>. Any texts that appears between opening <i> tag and closing </i> tag is shown in italic texts.
Syntax:
<i> ... </i>
Code:
<!DOCTYPE html>
<html>
<head>
<title>Italic Text</title>
</head>
<body>
<p>
This is a <i>line</i> using <i>italic element.</i>
</p>
</body>
</html>
Output:
Continue Reading on the next page …