Error with calc in Safari!

3

I'm having problems with Safari 5.1, the css width: calc (100% - 350px); does not work correctly on Safari, follow the code and jsfiddle:

JSFIDDLE

<div id="menu"></div>
<div id="conteudo2"></div>

#conteudo2 {
width: -webkit-calc(100% - 150px);
width: -moz-calc(100% - 150px);
width: calc(100% - 150px);
background-color: #333333;
float: left;
height: 920px;
margin-top: -10px;
}

#menu {
width: 150px;
float: left;
height: 900px;
background-color: #f2f2f2;
}

In other browsers it is working correctly !!

    
asked by anonymous 11.08.2014 / 20:04

1 answer

4

The calc function is only supported from safari 6.0.

Source: link

You can do the calculations using javascript, for example:

var element1 = document.getElementById('elemento1');
var element2 = document.getElementById('elemento2');
element2.style.width = element1.style.width - 350;

Something like this.

    
11.08.2014 / 21:17