Bold, Italic, Underlined Text
HTML allows us to change the appearance of our text to emphasize key parts of our content. Among the most common formatting options are making text bold, italic, and underlined. Let's discover how to apply these formatting styles in your HTML documents.
Bold Text
To make a text bold in HTML, we use the <strong>
tag. The text enclosed within this tag will appear bold in the web browser. Here's an example:
This is a <strong>bold</strong> text.
When rendered in a web browser, it will look like this:
This is a bold text.
Italic Text
To make a text italic in HTML, we use the <em>
tag. This tag emphasizes the text enclosed within it by displaying it in italics. Here's an example:
This is an <em>italic</em> text.
When displayed in a web browser, it will look like this:
This is an italic text.
Underlined Text
Underlining text in HTML can be achieved with the <u>
tag. However, be cautious when using this tag. Underlined text is often associated with hyperlinks in web design. Here's an example:
This is an <u>underlined</u> text.
In a web browser, it will look like this:
This is an underlined text.
Combining Formatting Styles
You can combine these formatting styles to emphasize your text even further. To do this, simply nest the tags within each other. For example, to create a bold, italic, and underlined text, you can do this:
This is a <strong><em><u>bold, italic, and underlined</u></em></strong> text.
In a web browser, it will look like this:
This is a bold, italic, and underlined text.
Conclusion
HTML provides tags that allow you to format your text to fit the needs of your content. By using the <strong>
, <em>
, and <u>
tags, you can make your text bold, italic, and underlined, respectively. You can even combine these styles to create a more emphasized text. Remember to use these tags responsibly to maintain the readability of your content.
Happy coding!