2017-03-09 84 views
-1

我有这两行代码在Chrome和Firefox中工作,但不在IE11中。带有小数点的计算器在IE11中不起作用?

height: calc((100% - 25px)/2); // this is not working 
left: calc(105px/2); // this is working 

请给我建议一个解决方案。

.relative-cell{ 
 
    position: relative; 
 
    height: 100%; 
 
} 
 
.downline, .upline{ 
 
    position: absolute; 
 
    height:calc((100% - 25px)/2); 
 
    background-color:rgba(0, 0, 0, 0.2); 
 
    width: 1px; 
 
    left:calc(105px/2); 
 
}
<td class="relative-cell"> 
 
    <div class="transaction-body transaction-date-section flex-row to-center to-mid"> 
 
     <div one-svg="long-arrow" class="account-transaction-type transaction-type"></div> 
 
    </div> 
 
    <div class="downline"></div> 
 
    <div class="upline"></div> 
 
</td>

+0

IE的哪个版本calc()? 7? 8? 9? 10? 11?企业模式?兼容性视图启用?任何组策略设置或站点列表?我们需要的不仅仅是“它在IE中不起作用”。 – csmckelvey

+0

请按建议添加信息,并提供测试示例(例如内联代码片段或JSFiddle)。 –

+0

阅读这个问题,看看不是calc是这里打破的那个,如果不是所有的父母都有100%定义的身高,那么100%的身高不起作用。 http://stackoverflow.com/questions/16811716/height100-not-working-in-internet-explorer –

回答

-1

这是IE11一个已知问题,它不支持嵌套计算。

IE11被报告在使用嵌套表达式calc(), (例如,宽度:calc((100%-10px)/ 3); (即便将不同)

上CanIUse.com

+1

这段代码没有转换。 – TylerH

+0

我更新了答案以引用IE和'calc()'的正确问题。 –