HTML provides several elements for defining text with special meaning. Here are some common ones:
- Bold: Use the
<b>or<strong>tag. - Italic: Use the
<i>or<em>tag.
- Subscript: Use the
<sub>tag. - Superscript: Use the
<sup>tag.
- Small Text: Use the
<small>tag. - Marked Text: Use the
<mark>tag. - Deleted Text: Use the
<del>tag. - Inserted Text: Use the
<ins>tag. - Underlined Text: Use the
<u>tag. - Strikethrough Text: Use the
<s>tag. - Keyboard Input: Use the
<kbd>tag. - Code Snippet: Use the
<code>tag. - Sample Output: Use the
<samp>tag. - Variable: Use the
<var>tag. - Preformatted Text: Use the
<pre>tag. - Abbreviations: Use the
<abbr>tag. - Citations: Use the
<cite>tag. - Quotations:
- Inline Quote: Use the
<q>tag. - Block Quote: Use the
<blockquote>tag.
- Inline Quote: Use the
- Time Element: Use the
<time>tag to represent a specific date/time.
- Naming Files: Always ensure your HTML files have the
.htmlextension. - Live Server: Use Live Server to see changes in real-time without needing to refresh the browser manually.
- Semantic Tags: Prefer semantic tags like
<strong>and<em>over<b>and<i>for better accessibility.
By using HTML formatting tags, you can add meaning and emphasis to your text content. Mastering these tags helps improve the structure and accessibility of your web pages.
Happy coding!