Click to See Complete Forum and Search --> : defining different input type css


dwfwfan
07-18-2005, 02:52 AM
hi friends.
it is possible to define different css for different input types.
i want to do this.
i have a html page.
this page contains different form elements and many of them are <input ...>.
as you know;
for text boxes <input type="text">
for check boxes <input type="checkbox">
for radio <input type="radio">
for password boxes <input type="password">
for submit buttons <input type="submit"> etc.
i want to define a css top of the document and this css only effect type="text", and i define another css it only effect type="submit".
i wish i could express my problem.
thanks for your interests.

bathurst_guy
07-18-2005, 03:05 AM
Have you used CSS on other elements in your page? How did you apply these CSS styles to these elements? Using a class or id? Hmm...
CSS:

.text {
}
.submit {
}

HTML:

<input type="text" class="text" />
<input type="submit" class="submit" />

dwfwfan
07-18-2005, 03:58 AM
i want these css styles apply all of the text type input's without using class or id.
before i define a css tag particular to html tag a.
so all of the links on that page using that css without class or id.
same here again i want to define a css and all of the text input s on these page use that css without class or id.
thanks for your interest.

Feldon
07-18-2005, 09:23 AM
This can be done, but it is not well supported by browsers yet.

Here is a link:

http://academ.hvcc.edu/~kantopet/css/index.php?page=css+attr+selectors&parent=css+syntax&printme=true

ray326
07-18-2005, 11:15 PM
As in Feldon's reference, you can do that using the selector input[type="text"] but it's only handled properly by web browsers.