Change Text Color Inside Text Box In HTML

In this article I will explain how to change text color of text inside text box in HTML.
  • 4940

Introduction

In this article I will explain how to change text color of text inside text box in HTML. We can change the color of text inside the textbox.

Suppose I want to implement a text input box for writing comments. I would like to font color of the text to be green. We can do this by applying the color property of CSS to the HTML textarea element. Write following code snippet to change text color.

Example:

<!DOCTYPE html >

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Change Textbox Text Color</title>

</head>

<body>

  <h2>Change Textbox Text Color</h2>

<form action="https://dotnetheaven.com" method="post">

Comments:<br /><br />

<textarea name="comments" id="comments" style="width:160px;height:90px;color:#53760D;font:24px/30px cursive;">

Do Comment Here....!

</textarea><br />

<input type="submit" value="Submit" />

</form>

</body>

</html>

 

Output:


TextBox_TextColor.jpg

© 2020 DotNetHeaven. All rights reserved.