Forum Moderators: not2easy

Message Too Old, No Replies

Change textarea appearance

need to change just one of several text input boxes

         

Storyman

5:49 am on Dec 28, 2004 (gmt 0)

10+ Year Member



There are several text boxes on the page that display fields from a database. The user can change the text, then submit to make changes.

All of the text is black against a white background except for one input text field. I'd like the text to appear red against a white background, but adding a class to change the text color has no impact.

Is it possible to change the font color for just one of the input text fields? I imagine that there has to be a way to accomplish this with 'textarea', but don't know how to make an exception for one text box.

bedlam

6:04 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All of the text is black against a white background except for one input text field. I'd like the text to appear red against a white background, but adding a class to change the text color has no impact.

I'm not sure what you mean; what browser are you using? It works in every newer browser I tested on: Firefox 1.0, Opera 7.5, and IE 6 (it doesn't work in Netscape 4.x though, surprise surprise...)

Try this:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>HTML 4.01 Transitional</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
textarea.special {
color:#900;
font-weight:bold;
}
</style>
</head>
<body>
<form>
<textarea class="special">Lorem ipsum dolor sit amet consectetuer.</textarea>
<textarea>Lorem ipsum dolor sit amet consectetuer.</textarea>
</form>
</body>
</html>

-B

Storyman

6:10 am on Dec 28, 2004 (gmt 0)

10+ Year Member



bedlam,

Gremlins must have been at work inside my computer. I had tried it before and it didn't work, but your code chased those Gremlins out and it works fine now.

Thanks for the quick reply.