HTML Text Formatting
In HTML, we can format text in various ways to enhance readability and presentation. Let's take a look at some of the common HTML text formatting tags.
Bold Text
We can make a text bold using the <strong> tag:
<strong>This text is bold</strong>
output: This text is bold
Italic Text
To italicize text, we use the <em> tag:
<em>This text is italicized</em>
output: This text is italicized
Superscript and Subscript Text
The <sup> and <sub> tags are used for superscripts and subscripts:
<p>This is how you write H<sub>2</sub>O and E = mc<sup>2</sup>.</p>
output: This is how you write H2O and E = mc2.
Strikethrough Text
The <del> tag creates strikethrough text:
<del>This text is deleted</del>
output: This text is deleted
Inserted Text
The <ins> tag is used to underline text:
<ins>This text is inserted</ins>
output: This text is inserted
Marked Text
The <mark> tag is used to highlight text:
<mark>This is a marked text.</mark>
output: This is a marked text.
That's a basic overview of text formatting in HTML. Understanding these elements will help make your web pages more engaging and easier to read.