- HTML formatting involves enhancing the visual presentation of text.
- It enables text manipulation for improved aesthetics, eliminating the need for CSS.
- Various formatting tags within HTML facilitate techniques such as bold, italics, and underline, enhancing the text's visual prominence and emphasis
Bold and Italic:
- <strong>: Represents strong importance. Text inside this tag is typically displayed in bold.
- <em>: Represents emphasized text. Text inside this tag is usually displayed in italics.
<p>This is <strong> important </strong> and <em> emphasized </em> text.</p>
Underline and Strikethrough:
- <u>: Represents underlined text.
- <s>: Represents strikethrough text (crossed out).
<p>This is <u> underlined </u> and <s> strikethrough </s> text.</p>
Subscript and Superscript:
- <sub>: Represents subscript text (lower and smaller).
- <sup>: Represents superscript text (upper and smaller).
<p>the water 👉 H<sub>2</sub>O</p>
<p>Theory of Relativity 👉 e=mc<sup>2</sup></p>
Preformatted Text:
- <pre>: Represents preformatted text, preserving spaces and line breaks.
- <kbd> Tag: The <kbd> tag represents keyboard input, indicating that the enclosed content should be treated as something a user would type on a keyboard. It is often used to show examples of keyboard commands or shortcuts.
- <abbr> Tag: The <abbr> tag stands for "abbreviation" and is used to mark up abbreviations or acronyms in your content.
<p>
<abbr title="World Health Organization">WHO</abbr> is an international
organization.
</p>
<mark> Tag:
- The <mark> tag is used to highlight or mark a portion of text to draw attention to it. It typically results in a yellow background color behind the marked text, making it stand out visually.
<p>Highlight <mark>this text</mark> to emphasize it.</p>
<small> Tag:
- The <small> tag is used to indicate that the enclosed text should be displayed in a smaller font size. It's often used for fine print, legal disclaimers, or less important information.
<p>This is a <small>smaller font size</small> text.</p>
<del> Tag:
- The <del> tag is used to represent deleted or removed text in a document. Browsers typically render the text with a strike-through line to indicate that it has been deleted.
<p><del>My favorite color is green red.</p></del>
Inline Styles:
- You can use inline CSS styles to apply formatting directly to specific text elements.
<p style="color: green">
Inline style is one of the way to style HTML content
</p>
0 Comments:
Post a Comment
Do leave your comments