How to perform arithmetic operations in CSS?

后端 未结 3 456
情话喂你
情话喂你 2020-12-25 11:30

I want to know how can I achieve an arithmetic operation in CSS.

For example: I want to align two divs side by side each having width of 50% and I w

3条回答
  •  孤城傲影
    2020-12-25 12:01

    It is possible with a CSS precompiler. LESS ans Sass are very popular. You can write it just the way you did it in the example above.

    http://www.lesscss.org/

    LESS is more easy to handle when you are a designer. For programmers and Ruby (on Rails) developers Sass maybe the better choice.

提交回复
热议问题