HTML Formatting Elements
HTML formatting refers to the use of specific tags in HTML (HyperText Markup Language) to change the appearance of text content. These tags help you make text bold, italic, underlined, or highlighted, among other styles.
Proper formatting not only improves the look of a website but also enhances readability, accessibility, and SEO (Search Engine Optimization).
Use of HTML Formatting
- The appearance of any text provides a clear view of the content intent, such as highlighting the keywords, putting meaningful information in the quotations, underlining the main sentence, etc.
- Formatting helps search engines understand the content structure and is also helpful for search engine optimization.
- Formatting improves the visual layout and improves the readability of the content.
Common HTML Formatting Tags
<b>
– Bold Text (Non-Semantic)
The <b>
tag makes text bold but doesn’t add any special importance.
<strong>
– Important Text (Semantic)
The <strong>
tag is similar to <b>
, but it also implies that the text is important for SEO and accessibility.
<i>
– Italic Text (Non-Semantic)
The <i>
tag italicizes text for stylistic purposes.
<em>
– Emphasized Text (Semantic)
The <em>
tag emphasizes text and also has semantic meaning.
<u>
– Underlined Text
The <u>
tag underlines the enclosed text.
<mark>
– Highlighted Text
Use the <mark>
tag to highlight text.
<small>
– Smaller Text
The <small>
tag renders text in a smaller font size.
<del>
– Deleted Text
The <del>
tag shows deleted text, often displayed with a strikethrough.
<ins>
– Inserted Text
The <ins>
tag indicates inserted text, often underlined.
<sub>
and <sup>
– Subscript and Superscript
Use <sub>
for subscript and <sup>
for superscript.
HTML Structure
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>Webpage’s Heading</h1>
<p>Hello World.</p>
</body>
</html>