You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Qunhuan Mei <qm...@qm18.wanadoo.co.uk> on 2009/04/27 12:31:07 UTC

How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Hi,

 

I have a form which uses struts tag “textfield” and “text”. The default font
style for label generated for textfield appears to be italic while the one
for text is normal. 

 

e.g. for 

 

       <s:textfield key="username" name="userAccount.username"
required="true" />

 

The html code generated by struts are (seen by the browser’s view source.):

 

   <tr>

         <td class="tdLabel"><label for="form_userAccount_username"
class="label">Username<span class="required">*</span>:</label></td>

         <td><input type="text" name="userAccount.username" value=""
id="form_userAccount_username"/></td>

</tr>

The label name “Username” is displayed in Italic (I suppose this is
controlled by either the tdLabel or label class). 

 

I want to change Username’s font style to normal (non-italic) and so have
tried cssStyle and cssClass for the textfield but it seems they are only
applied to the input field element rather than the label one.

 

I have searched the internet but no luck in finding an answer.

 

It would be much appreciated if anyone could help.

 

Many thanks in advance,

 

Qunhuan

 


RE: How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Posted by Qunhuan Mei <qm...@qm18.wanadoo.co.uk>.
Silly me. After I added “.label {font-style:normal; }” to my css file, no
more italic present in the input form. Thank you again Dave.

 

-----Original Message-----
From: Qunhuan Mei [mailto:qm@qm18.wanadoo.co.uk] 
Sent: Monday, April 27, 2009 12:59 PM
To: 'Struts Users Mailing List'
Subject: RE: How to turn the struts textfield label from default italic to
normal (struts 2.1.6)

 

Dave, 

 

Thank you so much for your reply. It is a big relief when hope is shown for

solving the problem.

 

Could you confirm that by your stylesheet overriding approach do you mean to

write some css code for the below "tdLabel" (or "label", if applicable)

class?

 

Qunhuan

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

BTW, found a similar problem reporting link:

 

http://markmail.org/message/hl6mic6scgxaj5lz#query:struts%20cssStyle%20cssCl

ass%20green+page:1+mid:nm6ws7bq2wmbmnl3+state:results

 

 

 

 

 

-----Original Message-----

From: Dave Newton [mailto:newton.dave@yahoo.com] 

Sent: Monday, April 27, 2009 12:41 PM

To: Struts Users Mailing List

Subject: Re: How to turn the struts textfield label from default italic to

normal (struts 2.1.6)

 

 

 

 

 

While I haven't noticed this behavior, you can override the S2 

 

stylesheet by including your own stylesheet with overriding definitions 

 

after the S2 head tag.

 

 

 

Dave

 

 

 

Qunhuan Mei wrote:

 

> Hi,

 

> 

 

>  

 

> 

 

> I have a form which uses struts tag “textfield” and “text”. The default

font

 

> style for label generated for textfield appears to be italic while the one

 

> for text is normal. 

 

> 

 

>  

 

> 

 

> e.g. for 

 

> 

 

>  

 

> 

 

>        <s:textfield key="username" name="userAccount.username"

 

> required="true" />

 

> 

 

>  

 

> 

 

> The html code generated by struts are (seen by the browser’s view

source.):

 

> 

 

>  

 

> 

 

>    <tr>

 

> 

 

>          <td class="tdLabel"><label for="form_userAccount_username"

 

> class="label">Username<span class="required">*</span>:</label></td>

 

> 

 

>          <td><input type="text" name="userAccount.username" value=""

 

> id="form_userAccount_username"/></td>

 

> 

 

> </tr>

 

> 

 

> The label name “Username” is displayed in Italic (I suppose this is

 

> controlled by either the tdLabel or label class). 

 

> 

 

>  

 

> 

 

> I want to change Username’s font style to normal (non-italic) and so have

 

> tried cssStyle and cssClass for the textfield but it seems they are only

 

> applied to the input field element rather than the label one.

 

> 

 

>  

 

> 

 

> I have searched the internet but no luck in finding an answer.

 

> 

 

>  

 

> 

 

> It would be much appreciated if anyone could help.

 

> 

 

>  

 

> 

 

> Many thanks in advance,

 

> 

 

>  

 

> 

 

> Qunhuan

 

> 

 

>  

 

> 

 

> 

 

 

 

 

 

---------------------------------------------------------------------

 

To unsubscribe, e-mail: user-unsubscribe@struts.apache.org

 

For additional commands, e-mail: user-help@struts.apache.org

 

 

 


RE: How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Posted by Qunhuan Mei <qm...@qm18.wanadoo.co.uk>.
Dave, 

 

Thank you so much for your reply. It is a big relief when hope is shown for
solving the problem.

 

Could you confirm that by your stylesheet overriding approach do you mean to
write some css code for the below "tdLabel" (or "label", if applicable)
class?

 

Qunhuan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BTW, found a similar problem reporting link:

http://markmail.org/message/hl6mic6scgxaj5lz#query:struts%20cssStyle%20cssCl
ass%20green+page:1+mid:nm6ws7bq2wmbmnl3+state:results

 

 

-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com] 
Sent: Monday, April 27, 2009 12:41 PM
To: Struts Users Mailing List
Subject: Re: How to turn the struts textfield label from default italic to
normal (struts 2.1.6)

 

 

While I haven't noticed this behavior, you can override the S2 

stylesheet by including your own stylesheet with overriding definitions 

after the S2 head tag.

 

Dave

 

Qunhuan Mei wrote:

> Hi,

> 

>  

> 

> I have a form which uses struts tag “textfield” and “text”. The default
font

> style for label generated for textfield appears to be italic while the one

> for text is normal. 

> 

>  

> 

> e.g. for 

> 

>  

> 

>        <s:textfield key="username" name="userAccount.username"

> required="true" />

> 

>  

> 

> The html code generated by struts are (seen by the browser’s view
source.):

> 

>  

> 

>    <tr>

> 

>          <td class="tdLabel"><label for="form_userAccount_username"

> class="label">Username<span class="required">*</span>:</label></td>

> 

>          <td><input type="text" name="userAccount.username" value=""

> id="form_userAccount_username"/></td>

> 

> </tr>

> 

> The label name “Username” is displayed in Italic (I suppose this is

> controlled by either the tdLabel or label class). 

> 

>  

> 

> I want to change Username’s font style to normal (non-italic) and so have

> tried cssStyle and cssClass for the textfield but it seems they are only

> applied to the input field element rather than the label one.

> 

>  

> 

> I have searched the internet but no luck in finding an answer.

> 

>  

> 

> It would be much appreciated if anyone could help.

> 

>  

> 

> Many thanks in advance,

> 

>  

> 

> Qunhuan

> 

>  

> 

> 

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: user-unsubscribe@struts.apache.org

For additional commands, e-mail: user-help@struts.apache.org

 


Re: How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Posted by Dave Newton <ne...@yahoo.com>.
While I haven't noticed this behavior, you can override the S2 
stylesheet by including your own stylesheet with overriding definitions 
after the S2 head tag.

Dave

Qunhuan Mei wrote:
> Hi,
> 
>  
> 
> I have a form which uses struts tag “textfield” and “text”. The default font
> style for label generated for textfield appears to be italic while the one
> for text is normal. 
> 
>  
> 
> e.g. for 
> 
>  
> 
>        <s:textfield key="username" name="userAccount.username"
> required="true" />
> 
>  
> 
> The html code generated by struts are (seen by the browser’s view source.):
> 
>  
> 
>    <tr>
> 
>          <td class="tdLabel"><label for="form_userAccount_username"
> class="label">Username<span class="required">*</span>:</label></td>
> 
>          <td><input type="text" name="userAccount.username" value=""
> id="form_userAccount_username"/></td>
> 
> </tr>
> 
> The label name “Username” is displayed in Italic (I suppose this is
> controlled by either the tdLabel or label class). 
> 
>  
> 
> I want to change Username’s font style to normal (non-italic) and so have
> tried cssStyle and cssClass for the textfield but it seems they are only
> applied to the input field element rather than the label one.
> 
>  
> 
> I have searched the internet but no luck in finding an answer.
> 
>  
> 
> It would be much appreciated if anyone could help.
> 
>  
> 
> Many thanks in advance,
> 
>  
> 
> Qunhuan
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org