如何在IE和Mozilla中指定css属性text-fill-color(就像我为webkit做的-webkit-text-fill-color)

时间:2015-07-10 10:09:44

标签: html css

在chrome中显示颜色,但在IE中,FF如何使用此属性

CSS

List<string[]>

4 个答案:

答案 0 :(得分:2)

在Firefox和IE中,您没有<div data-ng-app="CustomerNew" data-ng-controller="CreateCustomerCtrl as custom" ng-init="getFormData();"> <tr> <tr> <td>Billing Type:</td> <td> <select id="listBillingType" ng- change="listBillingTypeselectedindexchange(custom.listBillingType)" data-ng-options="blngtype as blngtypee for (blngtype,blngtypee) in listBillingType" data-ng-model="custom.listBillingType" style="width: 182px !important; height: 34px;"> <option value="">Choose an option {{optional ? '(optional)' : ''}}</option> </select> </td> </tr> </div> 属性。使用Color而不是text-fill-color。

答案 1 :(得分:1)

AFAIK text-fill-color是一个非标准的,仅限webkit的属性。在其他浏览器中没有相同的东西(也许有人可以纠正我?)。

但是,由于此属性只是否决了标准颜色属性,您只需添加标准color属性作为后备......

#Grid td.note div.has-note i {
  color: red; /* all browsers */
  -webkit-text-fill-color: #b4efa8; /* webkit browsers only */
}

div {
  color: red; /* all browsers */
  -webkit-text-fill-color: blue; /* webkit browsers only */
}
<div>
  What colour am I?
</div>

答案 2 :(得分:1)

它可用于处理光标颜色。请参阅摘录...

textarea { display: block; width:100%; height: 5em; } /* Unimportant */ 

#t1 { color:  #ff0000; }
#t2 { color:  #ff0000; -webkit-text-fill-color: #0000ff; }
<textarea id="t1">I'm all RED ! Both text and cursor.</textarea>  
<textarea id="t2">My cursor is RED because of "color:", but my font face is BLUE because of "-webkit-text-fill-color:". I work only in Opera, Chrome, and should start working in new Firefox (v.48) by next month :) ...</textarea>  

例如,w3schools.com在他们的在线示例编辑器中使用它来突出显示代码。由于文本无法格式化,因此使用“-webkit-text-fill-color”使其透明,但保留光标,然后将代码克隆到底层div并为其着色。

答案 3 :(得分:0)

使用此CSS 只有webkit浏览器具有text-fill-color属性othes只有color属性

#Grid td.note div.has-note i {
  -webkit-text-fill-color: #b4efa8;
  color: #b4fa8;
}