In HTML 4 and XHTML, most formatting tags have been deprecated. The five that remained are shown in the table below. But in HTML5, none of these are considered formatting elements anymore.
||Bolds text||For "text to be stylistically offset from the normal prose without conveying any extra importance" (see reference)|
||Italicizes text||For "text in an alternate voice or mood" (see reference)|
||Renders teletype text||Deprecated in HTML5.|
||Increases font size||Deprecated in HTML5.|
||Decreases font size||For "side comments and small print" (see reference)|
The example below shows how they are used:
<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Non-deprecated formatting tags</title> </head> <body> <h1>Non-deprecated formatting tags</h1> <p> <b>Bold</b> <i>Italicized</i> <tt>Teletype</tt> <big>Big font</big> <small>Small font</small> </p> </body> </html>
The page is rendered as follows:
All of these effects can be created with CSS, so if you just want to change the formatting without implying any specific meaning, you should use CSS instead.