我想在 flex textArea 中突出显示文本,但它的 htmlText 不支持<font bgcolor='#FFFF00'> part of my text </font>
,所以我正在寻找一种与 Courier new 相反的字体,当我将它嵌入到 Flash 中并用那种颜色书写时,我得到了突出显示效果我输入的那部分文本 <font family="negativeOfCourier" color='#FFFF00'> part of my text </font>
问问题
600 次
2 回答
1
<font style="font-family:courier;color:white;background-color:black;">white text goes here</font>
注意:我尝试将其发布为格式化,但 SO 似乎不接受字体标签。
编辑:您可以通过访问 http://www.w3schools.com自己找到这些东西。
于 2010-04-11T21:50:43.290 回答
1
您应该为此使用 StyleSheet。例子:
var theCSS:String = ".normaltext{color:#FFFF00;font-family:Courier}.highlightedtext{color:#FFFF00;font-family:Arial}";
var theStyle:StyleSheet = new StyleSheet();
theStyle.parseCSS(theCSS);
theTextArea.styleSheet = theStyle;
theTextArea.htmlText = '<span class="normaltext">Normal text here, and</span><span class="highlightedtext"> the highlighted text here</span>';
于 2010-04-11T21:54:12.443 回答