TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   XHTML, HTML, CSS (http://www.talkphp.com/xhtml-html-css/)
-   -   making text boxes a different color? (http://www.talkphp.com/xhtml-html-css/2252-making-text-boxes-different-color.html)

bmathers 02-15-2008 02:32 PM

making text boxes a different color?
 
hi,

im sure this is simple but im having trouble making some of my text input boxes a different color. This is the form,

<input name="Email" type="text" id="Email" size="50"/>

and this is how i thought i could do it but it deosnt seem to work when i upload it;

<input name="Email" type="text" id="Email" size="50" STYLE="background:ffcc33"/>

any help would be appreciated

cheers

Rendair 02-15-2008 02:51 PM

You can easily do this using CSS in the header

PHP Code:

<style type="text/css">

input{

   
bordersolid thing;
   
background-color#000000;
   
color#FFFFFF; 

}

textarea{

   
bordersolid thing;
   
background-color#000000;
   
color#FFFFFF;  
}

</
style

That will then change all text boxes on the page to them settings and all text areas to them settings.

bmathers 02-15-2008 02:54 PM

thanks for the reply, i know i can do that but i only want the required fields a different color. so i can only do it individually.

Rendair 02-15-2008 02:56 PM

If you wish to change a certain fields colour then you can set a class name for it

PHP Code:

<style type="text/css">

.
MyField{

   
bordersolid thin;
   
background-color#000000;
   
color#FFFFFF; 

}

</
style

PHP Code:

<input name="Email" type="text" id="Email" size="50" class="MyField"

or you can simply use the id of that field instead of creating a class attribute

PHP Code:

<style type="text/css">

#Email{

   
bordersolid thin;
   
background-color#000000;
   
color#FFFFFF; 

}

</
style

PHP Code:

<input name="Email" type="text" id="Email" size="50"


wGEric 02-15-2008 06:46 PM

Code:

<input name="Email" type="text" id="Email" size="50" STYLE="background: #ffcc33"/>
You need the number sign in front of the hexidecimal color number in order for yours to work. Everything else looks correct.


All times are GMT. The time now is 02:14 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0