Home >>HTML Tutorial >HTML Formatting
HTML Formatting provides different types of text tags for better look and feel without using CSS.
There are many formatting tags in HTML.
The HTML text italic and emphasized text both are used to define italic text but the difference is emphasized tag added semantic importance to make the text italic. Both tags are need an opening tag and closing tag.
Let's take an example of HTML Italic or Emphasized:
<!DOCTYPE html> <html> <body> <p>Normal text</p> <p><i>This text is italic.</i></p> <p><em>This text is emphasized.</em></p> </body> </html>
Normal text
This text is italic.
This text is emphasized.
The HTML bold and strong text both are used to highlight the text but the difference is strong tag added semantic importance to make the text strong. Both tags are need an opening tag and closing tag.
Let's take an example of HTML Text bold or strong:
<!DOCTYPE html> <html> <body> <p>Normal text</p> <p><b>This text is bold.</b></p> <p><strong>This text is strong.</strong></p> </body> </html>
Normal text
This text is bold.
This text is strong.
HTML <mark> element is used to highlight and mark the text. It provides the yellow background color to the specified text.
Let's take an Example of <mark> element:
<!DOCTYPE html> <html> <body> <p>Welcome to<mark>phptpoint</mark>.</p> </body> </html>
Welcome to phptpoint.
HTML <small> element provides the smaller text. It also needs an opening and closing tag.
Let's take an Example of <small> element:
<!DOCTYPE html> <html> <body> <p>It Provides <small>smaller</small> text</p> </body> </html>
It Provides smaller text.
HTML <ins> element helps to added/inserted a new text to the page. It also needs an opening tag and closing tag.
Let's take an Example of <ins> element:
<!DOCTYPE html> <html> <body> <p>My Favorite place is <ins>Noida</ins></p> </body> </html>
My Favorite place is Noida
HTML <del> Element is used to strike through the marking the part as deleted or removed text. It also needs an opening tag and closing tag.
Let's take an Example of <del> element:
<!DOCTYPE html> <html> <body> <p>My Favorite place is <del>Noida</del> Delhi.</p> </body> </html>
My Favorite place is Noida Delhi.
The <sub> or <sup> element is used to subscript or superscript a text. Subscript provide the specified text placed at the bottom of the text and Superscript provide the specified text placed at the top of the text.
Let's take an example of <sub> or <sup> Element:
<!DOCTYPE html> <html> <body> <p>This is Normal Text : X2</p> <p>This is subscript: X<sub>2</sub></p> <p>This is superscript:X<sup>2</sup></p> </body> </html>
This is Normal Text : X2
This is subscript: X2
This is superscript: X2