CSS value as mathematical expression

前端 未结 4 1151
一向
一向 2021-02-07 07:30

Is there anyway that I can write a css value as mathematical expression? Example:

div{
    height: 50% + 30px;
    width: 40em - 5px;
   }

If t

4条回答
  •  死守一世寂寞
    2021-02-07 07:52

    You can not do this with CSS, but you could (and much more) with a CSS preprocessor, like LESS, SASS or my favorite Stylus. THe final output is plain old CSS, but it must be compiled first.

提交回复
热议问题