The <small> tag was earlier (before HTML5) was used to display the text in smaller size in the output. The texts which is written between the start and end tag of <small> element will be displayed smaller in the output. Since HTML5 its been used to also display the side comments.
Hence a <small> tag can be used to display text in small size and also to display side comment and print text. We should use <small> only on inline content. It should not be used only to display a text in smaller size, for such cases its a better idea to use CSS styling. A common example for inline texts are copyright statement in a page footer, a disclaimer, or licensing information. In brief, small element emphasis more on the inline comments rather than the smaller text.
The Syntax of the <small> Tag
<small> body content </small>
Browser Suport
All major browsers support <small> tag.
HTML5 Small Tag Example
<!DOCTYPE html> <html> <head> <title>Small element </title> </head> <body> <div style="width:500px;text-align:justify"> <p> "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p> <small>Copyright 2014 <a rel="license" href="https://javabeat.net">JavaBeat</a></small> </div> </body> </html>
In the above example we can see that we have used <small> tag to display the copyright message.
Example Application Test
- Save the file as small_example.html in your system.
- Just open the file in the browser, you will see the below picture in the browser. Note that the browser must support HTML5 specification.
Output
When the execution process is completed successfully we will get the following output :