HTML is a markup language used to develop a web page’s structure. With HTML, we can structure a whole website, design it, and make it ready to deploy.
In this shot, we’ll see what formatting is and how we can efficiently format HTML texts and make HTML pages look good without using CSS.
HTML formatting has various methods or tags, inline or block, that are used to enhance visual context and visual attraction.
This text formatting is done using predefined HTML tags and semantics.
These tags add various meanings to the text.
HTML has many elements that are used for formatting. Some of those are:
<b>
: The bold tag is an inline element that is used to bold a text in HTML. The text to be bolded is typed in between the start tag of the bold tag and the end tag.<p> This is a paragraph and this text <b>is bold</b> </p>
<strong>
: Just like the bold tag, this tag gives the bold attribute but the difference is that , it adds the importance attribute to the semantic of the text. The text draws the keyboard’s attention when navigating with the keyboard. The text is put in between the start and end tag as used in bold text. It is also an inline tag.
<p> This is a paragraph and <strong>this text is important</strong> </p>
<i>
: This is an element that is used to change an element font to italics. It has start and end tags and the text is typed between them.
<p> This is a paragraph and <i> this text is in italics</i></p>
<em>
: This is a tag that is used for emphasis. The text is typed in between to change the text.
<p> This is a paragraph and <em> this text is an emphasized text</em></p>
<mark>
: This element is used to mark a text or highlight it.
<p> This is a paragraph and <mark> this text is marked</mark></p>
<small>
: It is used to get smaller text.
<p> This is a paragraph and this text is <small> small </small></p>
<del>
: It is used to identify deleted text or irrelevant text.
<p> This is a paragraph and this text is <del> deleted </del></p>
<ins>
: This tag defines inserted text in a document.
<p>This is a paragraph and this text is <ins>inserted</ins></p>
<sub>
: This defines subscript text.
<p> This is a paragraph and this text is a <sub>subscript</sub></p>
<sup>
: This defines superscript text.
<p> This is a paragraph and this text is a <sup>superscript</sup> </p>
You change the styles in the HTML tab and see the updated text in the output tab below:
Using HTML efficiently is very important while coding. Make sure you study these tags and practice for better understanding.