You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hansjörg Meuschel <hj...@gmx.de> on 2006/05/24 08:25:33 UTC

css problem with default input type="text"

Hello,
how do I define a default background color for text input elements 
only(!) in css?

Defining something like
input {
    background-color: #EFEFEF;
}
makes all buttons look ugly so I'm searching for a way to define this 
for text type inputs only...

any ideas?
greets hans

Re: css problem with default input type="text"

Posted by Jeff Bischoff <jb...@klkurz.com>.
 > i can't set any style attributes for the input (as far as I know...)

Well you're about to find out how! There are many CSS attributes on the 
t:inputCalendar tag, but it is actually the most basic one - styleClass 
- that gets applied to the text input box!

In fact, I have just tested it out for you in my own webapp. My new 
background color displays beautifully on the calendar input boxes, just 
as it does on the rest of my input boxes. :)

styleClass has no affect on the actually javascript popup appearance, 
only on the input text box.

Cheers,

Jeff Bischoff
Kenneth L Kurz & Assoc, Inc.

Hansjörg Meuschel wrote:
> Thanks Zhi,
> but it does not because I want to change the style of a text input 
> rendered by the calendar component - i can't set any style attributes 
> for the input (as far as I know...)
> 
> Zhi wrote:
> 
>> Hi,
>> Actually, neither do I know the answer. But I have a work around since 
>> I have the same requirement a little bit like yours.
>>
>> In html,
>>
>> <input type="text" class="mytext" ...>
>>
>> In CSS,
>> input.mytext {
>>    background-color: #EFEFEF;
>> }
>>
>> Hope it helps.
>>
>> Zhi
>>
>>
>> ----- Original Message ----- From: "Hansjörg Meuschel" <hj...@gmx.de>
>> To: "MyFaces Discussion" <us...@myfaces.apache.org>
>> Sent: Wednesday, May 24, 2006 2:25 PM
>> Subject: css problem with default input type="text"
>>
>>
>>  
>>
>>> Hello,
>>> how do I define a default background color for text input elements 
>>> only(!) in css?
>>>
>>> Defining something like
>>> input {
>>>   background-color: #EFEFEF;
>>> }
>>> makes all buttons look ugly so I'm searching for a way to define this 
>>> for text type inputs only...
>>>
>>> any ideas?
>>> greets hans
>>>
> 
> 
> 



Re: css problem with default input type="text"

Posted by Hansjörg Meuschel <hj...@gmx.de>.
Thanks Zhi,
but it does not because I want to change the style of a text input 
rendered by the calendar component - i can't set any style attributes 
for the input (as far as I know...)

Zhi wrote:

>Hi, 
>
>Actually, neither do I know the answer. But I have a work around since I have the same requirement a little bit like yours.
>
>In html,
>
><input type="text" class="mytext" ...>
>
>In CSS,
>input.mytext {
>    background-color: #EFEFEF;
>}
>
>Hope it helps.
>
>Zhi
>
>
>----- Original Message ----- 
>From: "Hansjörg Meuschel" <hj...@gmx.de>
>To: "MyFaces Discussion" <us...@myfaces.apache.org>
>Sent: Wednesday, May 24, 2006 2:25 PM
>Subject: css problem with default input type="text"
>
>
>  
>
>>Hello,
>>how do I define a default background color for text input elements 
>>only(!) in css?
>>
>>Defining something like
>>input {
>>   background-color: #EFEFEF;
>>}
>>makes all buttons look ugly so I'm searching for a way to define this 
>>for text type inputs only...
>>
>>any ideas?
>>greets hans
>>


Re: css problem with default input type="text"

Posted by Zhi <zh...@gmail.com>.
Hi, 

Actually, neither do I know the answer. But I have a work around since I have the same requirement a little bit like yours.

In html,

<input type="text" class="mytext" ...>

In CSS,
input.mytext {
    background-color: #EFEFEF;
}

Hope it helps.

Zhi


----- Original Message ----- 
From: "Hansjörg Meuschel" <hj...@gmx.de>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, May 24, 2006 2:25 PM
Subject: css problem with default input type="text"


> Hello,
> how do I define a default background color for text input elements 
> only(!) in css?
> 
> Defining something like
> input {
>    background-color: #EFEFEF;
> }
> makes all buttons look ugly so I'm searching for a way to define this 
> for text type inputs only...
> 
> any ideas?
> greets hans

RE: css problem with default input type="text"

Posted by David Friedman <hu...@ix.netcom.com>.
I see it working in Firefox but not IE.  However, this blog makes some
suggestions on how to add javascript to make that happen on IE:

http://cf-bill.blogspot.com/2005/05/styling-all-input-typetext-webpage.html

Regards,
David

-----Original Message-----
From: Hansjörg Meuschel [mailto:hjmeu@gmx.de]
Sent: Wednesday, May 24, 2006 3:20 AM
To: MyFaces Discussion
Subject: Re: css problem with default input type="text"


thank you david - works great

David Friedman wrote:

>Try this:
>
>input[type="text"] { color: #EFEFEF; }
>input[type="submit"] { color: yellow; }
>
>Regards,
>David
>
>-----Original Message-----
>From: Hansjörg Meuschel [mailto:hjmeu@gmx.de]
>Sent: Wednesday, May 24, 2006 2:26 AM
>To: MyFaces Discussion
>Subject: css problem with default input type="text"
>
>
>Hello,
>how do I define a default background color for text input elements
>only(!) in css?
>
>Defining something like
>input {
>    background-color: #EFEFEF;
>}
>makes all buttons look ugly so I'm searching for a way to define this
>for text type inputs only...
>
>any ideas?
>greets hans


Re: css problem with default input type="text"

Posted by Hansjörg Meuschel <hj...@gmx.de>.
thank you david - works great

David Friedman wrote:

>Try this:
>
>input[type="text"] { color: #EFEFEF; }
>input[type="submit"] { color: yellow; }
>
>Regards,
>David
>
>-----Original Message-----
>From: Hansjörg Meuschel [mailto:hjmeu@gmx.de]
>Sent: Wednesday, May 24, 2006 2:26 AM
>To: MyFaces Discussion
>Subject: css problem with default input type="text"
>
>
>Hello,
>how do I define a default background color for text input elements
>only(!) in css?
>
>Defining something like
>input {
>    background-color: #EFEFEF;
>}
>makes all buttons look ugly so I'm searching for a way to define this
>for text type inputs only...
>
>any ideas?
>greets hans
>
>
>  
>


RE: css problem with default input type="text"

Posted by David Friedman <hu...@ix.netcom.com>.
Try this:

input[type="text"] { color: #EFEFEF; }
input[type="submit"] { color: yellow; }

Regards,
David

-----Original Message-----
From: Hansjörg Meuschel [mailto:hjmeu@gmx.de]
Sent: Wednesday, May 24, 2006 2:26 AM
To: MyFaces Discussion
Subject: css problem with default input type="text"


Hello,
how do I define a default background color for text input elements
only(!) in css?

Defining something like
input {
    background-color: #EFEFEF;
}
makes all buttons look ugly so I'm searching for a way to define this
for text type inputs only...

any ideas?
greets hans