How to do text formatting in HTML?
HTML allows you to format texts in several different ways, through which you can highlight, emphasize or style a piece of text. One thing you should keep in mind is that once you learn CSS, you will rarely use HTML for text formatting, but this doesn’t mean that HTML formatting is useless especially because it is important in making a website search engine friendly.
All formatting tags are closing tags, which means you need to close them after opening or else the browser won’t know when to stop styling your texts and apply that style to every text following the opening tag.
Following are some important formatting elements in HTML:
<b> : To make the text bold without assigning any importance to it.
<del> : This will put a strikethrough on the text implying that the piece of text has been cancelled.
<em> : This is a tag for screen-readers that will pronounce it with emphasis.
<i> : Enclosed text will have italic style applied to it.
<ins> : This will underline the piece of text.
<mark> : This will highlight the text enclosed in it.
<small> : Decreases the font size of text.
<strong> : Make the text bold and also assign importance to it.
<sub> : (Subscript) This is used for scientific notations for example, to denote number of atoms in a chemical formula.
<sup> : (Superscript) This is used for mathematical texts such as for indices.
We recommend you to try using these formatting tags and check the output in your browsers to get a very good understanding of these, knowing these 10 HTML tags is sufficient for web developers.