calc not working ie 11

Ahmed-Anas picture Ahmed-Anas · Aug 11, 2014 · Viewed 33.8k times · Source

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

JunM picture JunM · Aug 11, 2014

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

Demo