Author: M Abo Bakar Aslam
Text Elements
Here, we explain the commonly used HTML text elements that help structure and format content on a web page. It covers headings, paragraphs, line breaks, and various formatting tags such as bold, italic, emphasis, and semantic elements. Additionally, it introduces elements for edits, abbreviations, citations, and special text like subscript and superscript, highlighting their role in improving readability, accessibility, and SEO.
1. Headings (<h1> to <h6>):
There are six heading elements, <h1> through <h6>, used to define headings and subheadings. <h1> is the highest-level heading, representing the main title, and <h6> is the lowest-level heading. Headings are important for structuring content and for search engine optimization (SEO). They convey the hierarchy and importance of different sections of a web page.
2. Paragraph (<p>):
The <p> element is used to define paragraphs of text. It creates a new block of text, and browsers typically add space before and after a paragraph for better readability. Paragraphs are a fundamental way to structure text content on a web page.
3. Line Break (<br>):
The <br> element is used to insert a line break within text. It doesn’t create a new block like a paragraph; instead, it allows you to break text within the same paragraph or line.
4. Bold (<b>) and Strong (<strong>):
<b> is a non-semantic element used to make text bold. <strong> is a semantic element that gives text strong importance, which is usually displayed as bold. <strong> is preferred for conveying importance to assistive technologies and search engines.\
5. Italic (<i>) and Emphasis (<em>):
<i> is used for italicizing text, while <emi> is a semantic element for emphasizing text. Like <strongi>, <emi> is preferred for emphasizing text for accessibility and SEO.
6. Underline (<u>) and Deleted (<del>):
<u> is used to underline text, while <del> is used to indicate deleted or struck-through text. <del> is often used in conjunction with the element to show added text.
7. Inserted (<ins>):
The <ins> element is used to indicate inserted or added text within the content. It can be used in combination with <del> to show edits in documents.
8. Subscript (<sub>) and Superscript (<sup>):
<sub> is used for subscript text (e.g., chemical formulas), and <sup> is used for superscript text (e.g., exponents).
9. Abbreviation (<abbr>):
It is important for SEO. The <abbr> is used to define and format abbreviations or acronyms. It’s often used to provide a title or description for the abbreviation when users hover over it.
10. Citation (<cite>):
It is important for SEO. The <cite> is used to define the title of a work, such as a book, movie, or research paper, that is being cited within the text.