Getting percentages to work in CSS calc() for Firefox and Safari?

后端 未结 3 1230
难免孤独
难免孤独 2021-02-14 02:53

I\'m using the following calc() equation to calculate the width of two divs:

CSS

.MyClass {
    width: calc((100% - 800px) / 2);
    wid         


        
3条回答
  •  不要未来只要你来
    2021-02-14 03:43

    Works for me..: CSSDeck example --> in Firefox Nightly

    Are you using a CSS-preprocessor, which could interfere with calc()? Have you tried to replicate the issue in a controlled environment (plain html + css without any scripts etc)?

    EDIT: Also note that calc(100%-3em) might not work, while calc(100% - 3em) should.

提交回复
热议问题