Jump to content

Colored forms


dotkpay

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

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.