In HTML 4 and XHTML, all but five formatting tags were deprecated. But in HTML5, none of these are considered formatting elements any more and two of the elements are no longer available. The table indicates how HTML5 treats these tags now.
||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 **|
||Increases font size||** Deprecated **|
||Decreases font size||For "side comments and small print" (see reference)|
The example below shows how the three remaining "formatting" tags are used:
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <title>Formatting tags</title> </head> <body> <h1>Formatting tags</h1> <p> <b>Bold</b> <i>Italicized</i> <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.