[英]How to add multiple Text to asp:label control?
我目前有一個從字符串文件中提取文本的 asp 標簽。 我想在此標簽旁邊添加一個紅色 *。 我該怎么做呢?
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/>
您可以執行以下操作。 只需在 label 標簽的右側添加一個span
標簽,其樣式屬性的值為color: red
像這樣:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %>"/><span style="color:red;">*</span>
如果你想要*
與相同的文本比這應該工作:
<asp:Label ID="Label29" runat="server" Text="<%$ Resources:strings, sample_generalinformation %> <span style='color: red;'>*</span>"/>
否則,如果你想要在 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.