HTML formatting is very important. A website Designer should know how to format HTML texts.
You must know how to make a text bold, strong, italicize, emphasize, underline, marking of text, inserting a new text/s, deleting an old text by removing it, adding a subscript and superscript, making a text small and so on.
- If you want to show that a particular text has more importance than the normal text, then use strong tag.
- If you want to make your text appear more heavy as compared to the normal text, then use b tag. This does not make the text important rather makes it heavier and shows that this text has higher priority while reading to grab the attention of the user.
- If you want to emphasize on a particular text, then use em tag. This makes the text as an important text and the text appears like an italic text.
- If you want to italicize a particular text, then use i tag. This does not mark the text as an important text rather italicize the text only.
- If you want to show your text look smaller than the normal text, then you can use small tag. Note that , you can achieve similar result using CSS which is a better option. The use of small tag is specific to a particular need. This is not a replacement for subscript or superscript.
- If you want to show a particular text/s as a subscript text/s, then use sub tag. We use this tag mostly in chemical formulas and mathematical formulas
- If you want to show a particular text/s as a superscript text/s, then use sup tag. Mostly we use this tag in chemical formulas and mathematical formulas
- If you want to mark a particular text/s, then use mark tag. You can correlate this with a situation when you are reading a book and you want to mark a text or group of text with a marker.
- If you want to delete a particular text/s by removing it logically by a way of striking it out, then you can use
delete tagdel tag.
- If you want to insert new text/s by inserting it logically, then you can use (insert tag).
- There are some other formatting options like samp tag which is used to show the sample ouotput of a computer program,
code tagwhich is used to show the computer code, kbd tag which is used to show the keyboard input text, var tag which is used to show that this particular text is a variable. These tags are less frequently used and are only used in case of special requirements.
HTML Formatting for text
Example for HTML Formatting, list of all HTML Formatting for text.
|<strong>||Strong text - Texts which are important|
|<samp>||sample output of a computer program|
|<code>||To show the computer code - Like a programming code|
|<kbd>||keyboard input text|
|<var>||To display the text as a variable - Like Programming variable|
HTML <b> Tag
The <b> tag specifies a bold text. We do not use bold for marking our text as an important text. For marking your text as an important text, use <strong> tag
HTML <em> Tag
The tag emphasizes the text. It provides more emphasis on a particular text and makes that text an important text.
Example for emphasized text
HTML <i> Tag
The tag specifies text in italic form. We use this tag to make our text stand out different from surrounding texts.
HTML <small> Tag
The <small> tag reduce the size of font.
HTML <strong> Tag
The <strong> tag specifies important text.
HTML <sub> Tag
The <sub> tag defines subscript text.
HTML <sup> Tag
The <sup> tag defines superscripted text.
HTML <ins> Tag
The <ins> tag defines inserted text in HTML document.
HTML <del> Tag
It defines deleted text in HTML document.
This is used when you want to correct text/s but wish to show the previous value which must strike out.
In a way, this is used to correct a value by striking out the old value which is removed and replacing it with a new value.
HTML <mark> Tag
The HTML <mark> tag describes the marked text.
This was added as part of HTML5.
HTML <u> Tag
The <u> tag underlines specified text.
HTML <samp> Tag
The <samp> tag is rarely used in HTML. This is used in a case, you want to show the sample output of the computer program.
HTML <code> Tag
The <code> tag is rarely used in HTML. This is used in a case, you want to show the computer code.
HTML <kbd> Tag
HTML <var> Tag
The <var> tag is rarely used in HTML. This is used in a case, you want to define a text as a variable. And when you want to store a value in a variable and use that value in any mathematical calculation or an arithmetic operation. You can use this in case of programming variable as well.
Interview Questions & Answer
There are many Formatting Tags in HTML like, <b>, <i>, <mark>, etc. It is used for formatting text and HTML elements for better look and appearance.
<b> tag is used to bold the text.
<i> tag is used for italic text.
<mark> tag is used to mark the text.