dotkpay Posted June 14, 2011 Share Posted June 14, 2011 Hello, Am trying to decorate my forms with colors, like having a text input field with a different inner color other than white. Could anyone help me round this problem. Thanx in advance Quote Link to comment https://forums.phpfreaks.com/topic/239326-colored-forms/ Share on other sites More sharing options...
fugix Posted June 14, 2011 Share Posted June 14, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/239326-colored-forms/#findComment-1229478 Share on other sites More sharing options...
cssfreakie Posted June 14, 2011 Share Posted June 14, 2011 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 */ } Quote Link to comment https://forums.phpfreaks.com/topic/239326-colored-forms/#findComment-1229515 Share on other sites More sharing options...
fugix Posted June 14, 2011 Share Posted June 14, 2011 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.... Quote Link to comment https://forums.phpfreaks.com/topic/239326-colored-forms/#findComment-1229518 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.