HTML provides various exclusive tags to enhance the look and feel of the text. These tags make HTML text formatting easy, and there is no need to apply CSS or the style attribute.
There are tags for making text bold, italic, small, superscript etc.
Let's study all main HTML formatting elements in detail with corresponding examples.
We noticed these HTML elements alter text appearance when defined. Below is the list of all HTML text formatting tags.
<b> | Makes Text Bold |
<strong> | Makes Text Strong |
<i> | Makes Text Italic |
<em> | Makes Text Emphasized |
<mark> | Makes Text Highlighted |
<sup> | Makes Text Superscript |
<sub> | Makes Text Subscript |
<ins> | Makes Text Inserted |
<del> | Makes Text Deleted |
To make a text bold, we define it with HTML <b> element.
The element <b> is not an 'Empty Element'. So it has both the start and end tags.
The text that we want to make bold is written between the opening <b> and closing </b> tags.
The element <strong> is defined to make the text strong with semantic importance.
The text inside the opening <strong> and closing </strong> tags make an HTML <strong> element.
The text is generally displayed in bold on the browser's screens.
To make text italic, we define the text with an HTML <i> element.
The text stays inside the start tag <i> and end tag </i>.
We italicize particular texts to make them stand out from the surrounding sentence.
Generally, names, titles or technical terms and someone's thoughts are italicized.
The HTML <em> element is defined to emphasize the text.
The content within the start tag <em> and end tag </em> are displayed in italics.
The difference between the tag <i> and <em> is that the text defined with element <em> is pronounced with an emphasis when the screen reader reads it.
To make text small, we use the HTML <small> tag. The content is placed inside the <small> and </small> tags.
To highlight a text in HTML, we use <mark> element.
All we need to do is to put content within the start <mark> and end </mark> tags.
A text is defined with <sup> element to make it superscript.
The text to be superscripted is written inside the opening <sup> and closing </sup> tags.
Superscript texts are generally used in mathematical formulas like x2, y4 etc.
We use the HTML <sub> element to make text subscripted. In HTML, we widely use <sub> tags to show chemical formulas like NH3, O2 etc.
To subscript a text, we should write it between <sub> and </sub> tags.
The HTML <ins> element is defined on a text to mark them as an inserted text.
The text to be inserted is written between the <ins> and </ins> tags.
The browser will display the inserted text as underlined.
To strikethrough the text, we define <del> element. It indicates that the text is deleted. The text that is shown to be deleted is written between the start <del> and end </del> tags.
Tags | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
<b> | Yes | Yes | Yes | Yes | Yes |
<strong> | Yes | Yes | Yes | Yes | Yes |
<i> | Yes | Yes | Yes | Yes | Yes |
<em> | Yes | Yes | Yes | Yes | Yes |
<small> | Yes | Yes | Yes | Yes | Yes |
<mark> | Yes | Yes | Yes | Yes | Yes |
<sup> | Yes | Yes | Yes | Yes | Yes |
<sub> | Yes | Yes | Yes | Yes | Yes |
<ins> | Yes | Yes | Yes | Yes | Yes |
<del> | Yes | Yes | Yes | Yes | Yes |
1. HTML Tutorial |
2. Introduction to HTML |
3. Basic HTML Page |
4. HTML Editors |
5. Web Browser |
6. HTML History |
7. Basic HTML Tags |
8. HTML Elements |
9. HTML Attributes |
10. HTML Headings |
11. HTML Paragraphs |
12. HTML Text Formatting |
13. HTML Styles |
14. HTML Comment |
15. HTML Quotation |
16. HTML Colors |
17. HTML RGB Colors |
18. HTML HEX Colors |
19. HTML HSL Color |
20. HTML CSS |
21. HTML Links |
22. HTML Link Colors |
23. Link within Page |
24. HTML Images |
25. HTML Background Image |
26. HTML Image Map |
27. HTML Picture Element |
28. HTML Favicon |
29. HTML Table |
30. HTML Table Border |
31. HTML Table Size |