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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.