Jump to content

Recommended Posts

should be a simple change of the input's background-color, say you have a textbox like so

<input type="text" id="input_box">

to change the background color, either use an external stylesheet, or in the head of your document specify css using the <style> tags, so you would have

<style>
#input_box { background-color:#eeeeee; }
</style>

using whatever color you'd like

Link to comment
https://forums.phpfreaks.com/topic/239326-colored-forms/#findComment-1229478
Share on other sites

the above example works but assumes there is only 1 field in your form (because it uses an #id), which on average is pretty unlikely.

 

Now you could make a class, but if you want to change all fields by default with a background color, do the following

 

input[type="text"]{
   background:#f4a; /* pink */
}

Link to comment
https://forums.phpfreaks.com/topic/239326-colored-forms/#findComment-1229515
Share on other sites

the above example works but assumes there is only 1 field in your form (because it uses an #id), which on average is pretty unlikely.

 

Now you could make a class, but if you want to change all fields by default with a background color, do the following

 

input[type="text"]{
   background:#f4a; /* pink */
}

true, my example assumes you want only one field to be a different color which is unlikely, so i will give you an example of changing it to a class.

<input type="text" class="input_box">

<style>
.input_box { background-color:#eeeeee; }
</style>

of course if you want every single input with a type of "text" to have certain properties you can use the example that cssfreakie provided. Also a side note, @cssfreakie, you would choose pink as your color of choice.... :P

Link to comment
https://forums.phpfreaks.com/topic/239326-colored-forms/#findComment-1229518
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.