CSS3 calc(100%-88px) not working in Chrome

后端 未结 3 472

I noticed that my usage of the CSS3 calc() function as the unit for width is not working in the latest version of Chrome.

In the Chrome Deve

3条回答
  •  野性不改
    2020-11-30 07:35

    I struggled with calc property a bit and only below approach worked.

    -webkit-calc(~'100% - 40px'); // good: result 395px (in my application)
    

    every above suggestions like:

    -webkit-calc(100% - 40px); // bad: result 60%
    

    ended up with wrong calculation like 60%.

    Hope it helps somebody.

提交回复
热议问题