How to use Element for Styling In HTML
- <strong> is used to semantically indicate strong importance.
- <em> is used to semantically indicate emphasis.
- <u> is used to underline text.
- <b> is used for bold text styling, similar to <strong> but carries no semantic meaning.
Example: The example shows the above-explained approach.
<!DOCTYPE html>
<html>
<body>
<p>I am normal</p>
<p><strong>I am strong</strong></p>
<p><em>I am emphasized</em></p>
<p><u>I am underlined</u></p>
<p style="color:red;">I am red</p>
<p style="color:blue;"><b>I am blue and bold</b></p>
<p style="font-size:50px;">I am big</p>
<p>Hello <b>GFG</b></p>
</body>
</html>
Output:
How to Style Text in HTML?
The HTML style attribute adds styles to an element, such as color, font, size, and more. Here, we are going to learn how to style Text in HTML.
These are the following methods:
Table of Content
- Using CSS Styles
- Using Element for Styling
Contact Us