【问题标题】:Is there a negative for Courier new font?Courier新字体有负面影响吗?
【发布时间】:2010-04-11 17:42:36
【问题描述】:
我想在 flex textArea 中突出显示文本,但它的 htmlText 不支持 <font bgcolor='#FFFF00'> part of my text </font> 所以我正在寻找一种与 Courier new 相反的字体,当我将它嵌入到 Flash 中时,并用它写当我输入<font family="negativeOfCourier" color='#FFFF00'> part of my text </font>
【问题讨论】:
标签:
html
apache-flex
fonts
htmltext
【解决方案1】:
<font style="font-family:courier;color:white;background-color:black;">white text goes here</font>
注意:我试图发布它的格式,但 SO 似乎不接受字体标签。
编辑:您可以前往http://www.w3schools.com 自行查找这些内容。
【解决方案2】:
您应该为此使用样式表。
示例:
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>';