< s:textfield />单个字符的标签样式 [英] <s:textfield/> label styling for single character

查看:182
本文介绍了< s:textfield />单个字符的标签样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更改此标签中的一个字符的颜色,特别是 *

这需要更改几个部分,但是没有改变许多其他。有没有一个内联的方式来做这个?

 < td> 
< s:textfield label =*银行名称name =...size =40/>
< / td>


解决方案

c $ c>< span> 标签并在CSS中设置颜色。我不熟悉struct标记,但你应该能够应用相同的概念。如果没有,文章将有助于使用< label> < input> 标记。



尝试以下操作:



HTML:

  < table> 
< tr>
< td>
< label>< span class =diff-color> *< / span>银行名称< / label>
< / td>
< / tr>
< / table>

CSS:

 code> span.diff-color {
color:red;
}

这将设置所有span元素的颜色,类名为diff-color 变为红色。



示例。 / p>

I need to change the color of one character in this label specifically the *.
This will need to be changed for several sections, but not changed for many others. Is there an inline way for me to do this?

<td>
  <s:textfield label="* Bank Name" name="..." size="40" />
</td>

解决方案

You should be able to wrap the character in <span> tags and set the colour in CSS. I'm not familiar with struct markup, but you should be able to apply the same concept. If not, this article will be helpful to use the <label> and <input> tags to accomplish what you want.

Try this:

HTML:

<table>
   <tr>
      <td>
         <label><span class="diff-color">*</span> Bank Name</label>
      </td>
   </tr>
</table>

CSS:

span.diff-color {
    color: red;
}

That will set the color of all span elements with class name "diff-color" to red.

Example.

这篇关于&lt; s:textfield /&gt;单个字符的标签样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆