What is HTML Text Attribute

In this article we will discuss about how to change the color of the text in the HTML document using Text Attribute.
  • 2125

The text attribute in body tag in HTML is used to specify the color of the text in the HTML document. If we want we can change the color of the text in the HTML document by using color attribute of the font tag but when we use the text attribute of the body tag it will change the color of the text of the entire HTML document.

HTML Code:

<html>

<body text="firebrick" bgcolor="#CCFF99">

    Our deepest fear is not that we are inadequate.<br>

    Our deepest fear is that we are powerful beyond measure.<br>

    It is our light, not our darkness that most frightens us.<br>

    Your playing small does not serve the world.<br>

    <p>

        <a href="http://www.google.co.in">Google.com</a></p>

    <p>

        <a href="http://www.gmail.com">Gmail.com</a></p>

</body>

</html>

Output:

 selectt.jpg

In the above output we have seen that the color of the entire text in the HTML document is coming in the red color except the links.

Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.