Change Background Color Of Text Box In HTML

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

Introduction

In this article I will explain how to change color of your text box in HTML. Suppose your web page contains comment box and you want to change the background color of the comment box. You can do this by applying the CSS background color property to the textarea element.

Write following code snippet.

<!DOCTYPE html >

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

<head>

    <title>HTML TextField</title>

</head>

<body>

  <h2>HTML TextField</h2>

<form>

   Comments:<br /><br />

  <textarea name="comments" id="Textarea1" style="width:160px;height:90px;background-color:#D0F18F;">

Do Comment Here....!

  </textarea><br />

</form>

</body>

</html>

 

Output:

 

 TextBox_BackgroundColor.jpg

© 2020 DotNetHeaven. All rights reserved.