How to add color in HTML without CSS?

Brajagopal Tripathi
1 min readSep 6, 2023
Photo by Nick Karvounis on Unsplash

There are two ways to add color in HTML without CSS:

  1. Use the font tag with the color 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 the style 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.

--

--

Brajagopal Tripathi

Student of Computer Application and Network Administration || Cloud Technology and Cyber Security Enthusiast