IE 10中不支持text-decoration固体

时间:2017-04-26 13:25:45

标签: css html5 internet-explorer internet-explorer-10

此代码适用于Choreme和Firefox。但是没有在İE10上工作。表中的最后一个td不能生效。它必须正常。

     .gridview tr
     {

     font-size: 20px;
     border: solid 1px #c1c1c1; 

     padding-bottom: 3px;
     padding-top: 3px;
     font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
     background-color: #EEEEEE;
 }

 .noadres td {
         text-decoration:line-through;
         font-style:italic;
         background-color:#f5eded;

 }
     .noadres td.etkabone {
         text-decoration:solid;
         font-style:normal;
     }  

html

     <table  class="gridview">

 <tr class="noadres">
     <td>HELLO</td>
     <td>MY</td>
     <td class="etkabone" >NAME</td>

 </tr>

 </table>

https://jsfiddle.net/dwc7kjmo/

3 个答案:

答案 0 :(得分:2)

将CSS更改为:

 .noadres td.etkabone {
    text-decoration:none;
    font-style:normal;
 } 

solid对IE无效。

P.S。如果选择inspect元素,您将看到solid具有红色下划线。

答案 1 :(得分:2)

问题在于:

.noadres td.etkabone {
   text-decoration:solid; /*This is invalid value for this property for IE*/
    font-style:normal;
}

solid是此属性的默认值,但IE不支持它。

您可能希望普通字体没有透视。请将以上内容更改为:

.noadres td.etkabone {
    text-decoration:none;
    font-style:normal;
 } 

答案 2 :(得分:2)

在CSS2中,text-decoration property是一个常规属性,语法为:

  

无| [下划线||上线||直通||眨眼] |继承

CSS Text Decoration Module Level 3中:text-decoration属性现在是速记属性,语法为:

  

&LT;&#39;文字修饰线&#39;&GT; || &LT;&#39;文字修饰式&#39;&GT; ||   &LT;&#39;文字修饰色&#39;&GT;

其中&lt;&#39; text-decoration-style&#39;&gt;的值是:

  

稳固 |双|点缀|破灭|波状

所以现在你可以看到为什么文字装饰:坚固;适用于Chrome和Firefox,因为根据较新的规范 - 它是完全合法的代码。

以下是新text-decoration属性的browser support

请注意,IE不支持新语法。

因此,正如其他人提到的那样,您应该使用text-decoration:none来获得更好的浏览器支持。