Jump to content

[SOLVED] Font color in forms


sciencebear

Recommended Posts

That works, I just can't quite seem to put it on the right element. I'm trying to apply it to tags like this (all type="text"):

 

<form><input name="status" type="text" id="status" value="What are you up to?"/></form>

 

I tried this:

 

input#text{
color:#000;
}

input#text:focus{
color:#f00;
}

 

If I apply it to just input, it does it to all my form elements, including submit buttons. This method I though would work, but does not apply to anything.

The code you are showing there is attempting to style a tag with the ID of 'text'. In CSS2, you cannot target input elements by type (it's part of the CSS3 spec). So for now, you will have to apply a class to each of your text inputs, and use that to target the inputs in question.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.