How to use CSS Styles In HTML
The <b> tag makes text bold, while <strong> adds semantic importance, typically displaying as bold by default. Incorporating these tags improves readability and user engagement. The <p> tags enclose paragraphs of text, while inline styles defined with the style attribute modify their appearance. By specifying properties like color and font size directly within the tag, precise styling adjustments are achieved without the need for external CSS files.
Example: The example shows the above-explained approach.
<!DOCTYPE html>
<html>
<body>
<p>I am normal</p>
<p style="color:red;">I am red</p>
<p style="color:blue;">I am blue</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