HTML Formatting
HTML Formatting:
Formatting deals with text of different shapes and sizes. Various tags are present in HTML to shape text differently.
<strong> vs. <b> tag in HTML:
i. In HTML <b> tag is used to bold the text
Example:
<!DOCTYPE html>
<html>
<body>
<p><b>I am bold.</b></p>
</body>
</html>
I am bold.
ii. Strong tag is used to brief the text with strong importance and the matter present inside the <strong> tag is displayed in bold.
Example:
<!DOCTYPE html>
<html>
<body>
<strong>I am important tag</strong>
</body>
</html>
<em> vs. <i> tag in HTML:
i. In <emp> tag we are particularly emphasizing the text, it slightly creating pressure, and matter inside this tag is in italic shape. Pronouncing this word is not in a normal tone.
Example:
<!DOCTYPE html>
<html>
<body>
<em>This text is emphasized</em>
</body>
</html>
ii. This tag is spoken with a polite tone and the text is also tilted in shape.
Example:
<!DOCTYPE html>
<html>
<body>
<i>This text is italic inside </i>
</body>
</html>
<small>, <mark>, <del> and <ins> in html:
1. The <small> tag defines the tag in smaller size.
Example:
<small>This matter is in this tag.</small>
2. <mark> tag is used to highlighting the text with the default color in the background.
Example:
<p>hello how are you?<mark>all</mark> let meet today.</p>
hello how are you?all let meet today.
3. To show that the given text is removed from the document, we are using the <del> tag. Automatically a dashed line will come over the given text.
Example:
<p>the two bags in <del>blue</del>and red color</p>
the two bags in blueand red color
4. <ins> tag defines the text that is appended into the document, automatically the browser will underline the given text.
Example:
<p>The del tag is <del>blue</del> <ins>inserted tag is red in color</ins>.</p>
The del tag is blue inserted tag is red in color.
Html <sub> vs <sup> tag:
1. <sub>
This tag defines the given text in subscript and is used in chemical formulas like in the given example.
Example:
<p>Here is a<sub>subscripted</sub> text.</p>
Here is asubscripted text.
2. <sup>
Superscript text is defined by <sup> tag and it is used in the case of footnotes in docs.
Example:
<p>Here is a<sup>subscripted</sup> text.</p>
Here is asubscripted text.
See the Pen HTML Formatting by Jehal Desai (@my-dreamzlive) on CodePen.
