[英]How to add multiple Text to asp:label control?
I currently have an asp label that has text pull from a string file.我目前有一个从字符串文件中提取文本的 asp 标签。 I want to add a red * next to this label.
我想在此标签旁边添加一个红色 *。 How would I go about doing this?
我该怎么做呢?
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/>
You could do the following.您可以执行以下操作。 Just add a
span
tag to the right of your label tag, with a style attribute with the value of color: red
只需在 label 标签的右侧添加一个
span
标签,其样式属性的值为color: red
Like this:像这样:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/><span style="color:red;">*</span>
If you want *
along with the same text than this should work:如果你想要
*
与相同的文本比这应该工作:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %> <span style='color: red;'>*</span>"/>
Else if you want in seperaret than there is another option of doing it:否则,如果你想要在 seperaret 中,那么还有另一种选择:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/><span style="color:red;">*</span>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.