Question with HTML - changing font color inside textarea?

Can you change the color of text typed in <textarea> using css? If css is not possible, how bout directly in html

thanks

<textarea rows="12" name="fld1" cols="47" tabindex="8"></textarea>

3 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    you need css

    <head>

    <style type="text/css">

    <!--

    .fieldcolor {

    font-family: Arial, Helvetica, sans-serif;

    font-size: 12px;

    color: #990000;

    background-color: #CCCCCC;

    }

    -->

    </style>

    </head>

    <input type="text" class="fieldcolor" size="50" maxlength="125" />

  • 1 decade ago

    For css, simply change the color attrib of a text area:

    input, textarea

    {

    color: #ff0000;

    }

  • In your CSS portion you can use something like this:

    .textfield {background-color:white; font: 8pt/8pt arial; color:#ff0000; text-decoration: none}

    And later on in your text input portion you can use something like this:

    <input type=text size=8 name="as_q" class=textfield><br>

Still have questions? Get your answers by asking now.