【问题标题】:Is there a power function in CSS?CSS中有幂函数吗?
【发布时间】:2020-07-19 15:04:47
【问题描述】:

我知道你可以用循环在 Sass 中编写幂函数。 CSS中有专门的吗?还是一种写法?

【问题讨论】:

标签: css css-calc


【解决方案1】:

working group already approved such functions

CSS 工作组刚刚讨论了 trig,并同意以下内容:

已解决:添加 sin() cos() tan() acos() asin() atan() atan2() hypot() sqrt() pow()

现在在CSS Values and Units Module Level 4 Specification下:

指数函数pow()sqrt()hypot()log() 和 `exp() 使用参数计算各种指数函数。

pow(A, B) 函数包含两个逗号分隔的计算 A 和 B,两者都必须解析为 <number>s,并返回 A 的 B 次幂的结果,返回值为 <number> .

我们只需要等待浏览器的支持

【讨论】:

    猜你喜欢
    • 2010-11-29
    • 2013-04-22
    • 2018-05-08
    • 1970-01-01
    • 1970-01-01
    • 2020-11-16
    • 2010-11-26
    • 2015-06-13
    相关资源
    最近更新 更多