<small> Tag in HTML | Text Formatting
The <small> tag in HTML is used to define smaller text. It is typically used to indicate fine print, disclaimers, copyright information, or anything else that requires smaller text size compared to the surrounding text.
Key Points on <small> Tag:
- The <small> tag reduces the text size of the enclosed text.
- It is often used to display secondary or less important information, such as legal disclaimers or references.
- The <small> tag does not define any semantic meaning; it is purely a presentational element.
- Use CSS for better control over font sizes and styles in modern web design.
Syntax of <small> Tag:
Syntax Example
<small>This is smaller text</small>
Example of <small> Tag in HTML:
This example demonstrates how the <small>
tag makes text smaller.
Code Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Small Tag Example</title>
</head>
<body>
<h1>Welcome to Our Website</h1>
<p>This is an important announcement.</p>
<p>
<small>All rights reserved. © 2024 Company Name</small>
</p>
</body>
</html>
Output
Welcome to Our Website
This is an important announcement.
All rights reserved. © 2024 Company Name
The <small>
tag is useful when you want to display less important or supplementary information in a smaller font size. However, for more sophisticated text formatting, it's recommended to use CSS.