On Tue, 27 Mar 2007, Paul Seale wrote:

> I have a question regarding input tags. Currently when I cant to change the
> style of an input element (select menus, text input, etc) I use the .css
> input call.

So you have a rule with the element name input as the selector:

input { /* some CSS declarations */ }

> My question is this: Is there a way to break it out to format just the
> password and text fields?

Ideally you could use

input[type="text"], input[type="password"] { /* some CSS declarations */ }

but there's the problem that IE 6 and older won't understand it, because 
they do not recognize such attribute selectors. Moreover, [type="text"] 
matches only such elements that have type="text" _explicitly_ set, not 
defaulted as we often default in <input> elements.

So in practice it's safer to use class selectors, e.g. assign a class to 
each password and text field and use a class selector. Depending on the 
context, there might be other, more convenient ways, like contextual 
selectors, e.g.

#foo input { ... }

which applies to all input elements that are inside the element that has 
id="foo", and only to them.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to