Skip to content
doubtly

2 answers

<font> tag, is used to specify the text color.

  1. <font Color=”Blue”>  
  2. <font color=”rgb(128,128,0)”
  3. <font color=”#00FF00″>
<!DOCTYPE html>    
<html>     
<head>    
<title>    
 Example of color attribute   
</title>    
</head>    
<body>   
<font color="orange">   
<!-- The color attribute of font tag sets the color name 'orange' for the word Great Learningt-->   
<center>    
<h1>   
Great Learning 
</h1>   
</center>  
</font>     
</body>    
</html>
codelikepro · 19 Aug 2022 Report
Was this answer helpful?

Use the CSS color property, for example <p style="color:blue;">.

<p style="color:blue;">Blue text</p>
<p style="color:#00FF00;">Green text</p>
<p style="color:rgb(128,128,0);">Olive text</p>

The colour can be a name (red), a hex code (#FF0000) or rgb(). For many elements, write the rule once in a <style> block, e.g. p { color: navy; }.

The old <font color="..."> tag still works in most browsers but is obsolete and not part of HTML5, so it should not be used in new pages.

Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.