How to add color in HTML without CSS?
1 min readSep 6, 2023
There are two ways to add color in HTML without CSS:
- Use the
font
tag with thecolor
attribute.
- The
color
the attribute specifies the color of the text. You can use the name of a color, a hexadecimal color code, or an RGB color code. - For example, the following code will set the color of the text to red:
HTML
<font color="red">This text is red.</font>
- Use the
<span>
tag with thestyle
attribute. - The
style
the attribute allows you to specify the style of an element, including its color. - For example, the following code will set the color of the text to red:
HTML
<span style="color: red">This text is red.</span>
Here is an example of how to add color to a paragraph using the font
tag:
HTML
<p>
<font color="red">This paragraph is red.</font>
</p>
Here is an example of how to add color to a paragraph using the <span>
tag:
HTML
<p>
<span style="color: red">This paragraph is red.</span>
</p>
I hope this helps! Let me know if you have any other questions.