CSS: Selecting certain types of the <input>

liunx

Guest
I have an external style sheet and I want it to alter ONLY <input type="text" /> instead of radio buttons, etc.<br />
<br />
How can I select that?<br />
<br />
input{<br />
color:#990000;<br />
background-color:transparent;<br />
border:1px solid #990000;<br />
}<br />
<br />
The above example selects ALL input. How can I modify that to only the text field (and the submit/reset field actually)?<!--content-->so close to the answer! ;) <br />
<br />
input.foo {<br />
color:#990000;<br />
background-color:transparent;<br />
border:1px solid #990000;<br />
}<br />
<br />
or just:<br />
<br />
.foo {<br />
color:#990000;<br />
background-color:transparent;<br />
border:1px solid #990000;<br />
}<br />
<br />
<input class="foo" type="text"><br />
<br />
just add class="foo" to any html tag you want to have those properties<!--content-->yeah... well i know about classes and id's and stuff.<br />
<br />
but the thing is, I have so many input tags, and they are all over the site - and radios/checkboxes/submit/reset vs text input is so equal that putting a class to one of them is still tedious.<br />
<br />
thanks for the try. anyone else?<!--content-->without adding the class you have no other choice. as you found out that input{} selects all of them, to single them out you need a class or id. or if you want you can use in-line styles but that just gives you the same choice, singling them out.<!--content-->Originally posted by pyrexyn <br />
yeah... well i know about classes and id's and stuff.<br />
<br />
but the thing is, I have so many input tags, and they are all over the site - and radios/checkboxes/submit/reset vs text input is so equal that putting a class to one of them is still tedious.<br />
<br />
thanks for the try. anyone else? <br />
<br />
You're welcome but there is no other option, tedious or not its about all you can do. Use search and replace to make the edits and it will be faster and easier than otherwise.<!--content-->Hi there pyrexyn,<br />
<br />
If youknow about classes and id's and stuff.and find that putting a class to one of them is still tedious.then sayanyone else?<br />
why don't you solve your dilemma by paying someone else to design your web pages :P <br />
whilst you seek employment in a much more exciting and remunerative career ? :rolleyes:<br />
<br />
c:cool::cool:thead<!--content-->It really shouldn't be that tedious to fix...do a search and replace. Search for:<br />
input type="text"<br />
and replace with:<br />
input type="text" class="foo"<br />
<br />
You could do it in notepad.<br />
<br />
Aaron<!--content-->Originally posted by coothead <br />
Hi there pyrexyn,<br />
<br />
If youand find then say<br />
why don't you solve your dilemma by paying someone else to design your web pages :P <br />
whilst you seek employment in a much more exciting and remunerative career ? :rolleyes:<br />
<br />
c:cool::cool:thead <br />
<br />
While I find your observation to not be totally without merit, please refrain from posting gratuitous comments, they generally lead to unprofitable conclusions, thank you.<!--content-->Originally posted by AaronCampbell <br />
It really shouldn't be that tedious to fix...do a search and replace. Search for:<br />
input type="text"<br />
and replace with:<br />
input type="text" class="foo"<br />
<br />
You could do it in notepad.<br />
<br />
Aaron <br />
<br />
I have seen this suggeston a couple of times now by various people, but as far as I know, NotePad does not have a search and replace option, or has NotePad been upgraded recently?<!--content-->my notepad doesnt, but wordpad does, i think people get confused between the two!<!--content-->I have the notepad that comes with winXP pro. I guess it's version 5.1 and yes, it has a find and replace function, called simply replace, and no...it's not wordpad. If yours is the same as mine, you simply choose edit - replace, or press CTRL+H.<!--content-->Hi there kevin,<br />
<br />
I am sorry for behaving gratuitously....the red mist just came over me :o <br />
<br />
c:o:othead<br />
p.s. I have windowsXP home and NotePad comes with the 'Edit' and 'Replace' facility<!--content-->even 2000 has it.<!--content-->darned windows Me, i just scooted over to my 2000 machine and yeah it has it :D <br />
<br />
i'm living in the dark ages on my main pc :P<!--content-->thanks everyone<br />
<br />
yeah i have windows ME notepad<br />
<br />
besides, there's an important part i never told you people. This things is mixed with really complex PHP coding and stuff, and at least 50 includes and text-fileSystem stuff all over the place. It's gonna be a pain in the butt to do it manually even if had the replaces function lol<br />
<br />
oh well, i guess i'm getting my hands dirty tonight<!--content-->
 
Back
Top