Home » Tutorials » HTML » Formatting Tags

Formatting Tags

Formatting tags can be very useful when writing HTML and are more specific than creating general CSS classes for HTML elements. Formatting tags are primarily for modifying the way text appears. We can make the text bold, in italics, or even define them as a superscript or a subscript. There are a whole bunch of these so we will just focus on a few of the most often used formatting tags. These tags are just like any other HTML element in that they have closing and starting tags.

Example
<p>
    <b>I am bold</b>
    <i>I am in italics </i>
    <sub>Last</sub>, but not <sup>least</sup>
</p>
Result

I am bold I am in italics Last, but not least

While these formatting tags don’t make any major changes, it is nice to use them to accent text to help user understand your point. Like I said, there are quite a few of these, but the vast majority are never used anywhere because custom CSS classes have taken over. Basically, try to stick to only using these four formatting tags, unless you absolutely need to use another formatting tag. Also, you should research these tags before using them as some of them are going to become extinct with HTML5.

References



Link/cite this page

If you use any of the content on this page in your own work, please use the code below to cite this page as the source of the content.

  • Stewart, Suzy. "Formatting Tags". After Hours Programming. Accessed on March 16, 2024. https://www.afterhoursprogramming.com/tutorial/html/formatting-tags/.

  • Stewart, Suzy. "Formatting Tags". After Hours Programming, https://www.afterhoursprogramming.com/tutorial/html/formatting-tags/. Accessed 16 March, 2024.

  • Stewart, Suzy. Formatting Tags. After Hours Programming. Retrieved from https://www.afterhoursprogramming.com/tutorial/html/formatting-tags/.



0 thoughts on “Formatting Tags”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.