Ahmed-Anas Ahmed-Anas - 2 months ago 16
CSS Question

calc not working ie 11

After researching I confirmed that calc should work for ie8+ but it is not working for me.

Here is a JS fiddle I made:

http://jsfiddle.net/75tzyLoo/

here is the code:
HTML:

<div id="outer">
<div id="inner">

</div>
</div>


CSS:

#outer{
width:400px;
background-color:black;
height:200px;
}
#inner{
width:calc(80%-100px);
width:expression(80%-100px);
background-color:red;
height:100%;

}


and here is the output I see: JS Fiddle output for calc not working

What am I doing wrong?

Answer

"-" should be surrounded with spaces width:calc(80% - 100px);

Demo

Comments