aspx 字颜色

来源:百度知道 编辑:UC知道 时间:2024/06/07 21:49:06
<td align="right">
【回复<%# Eval("taxis")%>】
</td>

我想让<%# Eval("taxis")%>内容是红色,其它的不变,我只知道html有<font>属性可以改,不知道aspx用什么改颜色

用的是模板列帮顶吧,那再加个table就可以了,通过控制table的字体颜色
  <td>
  <table style=" margin:10 10 10 10;word-spacing:normal; line-height:20px;color:Red;">
  <tr>
  <td style="float:left; overflow:hidden;word-wrap:break-word;word-break:break-all;" ><%#Eval("Contents")%></td>
  </tr>
  </table>
  </td>

  要是想隔行换颜色就要用到模板列的奇偶行
  参考:
  <table id="ChangeColor" border="1" style=" width:100%; border:cc9966 1px; BORDER-COLLAPSE:collapse;">
  <asp:Repeater ID="RPReply" runat="server" OnInit="RPReply_Init">
  <ItemTemplate>
  <tr >
  <td style="width:22%">
  <table style=" margin:10 10 10 10;background-color:#99ccff;word-spacing:inherit; line-height:20px;">
  <tr>
  <td>回复人:<%#Eval("IssuerName")%>