CSS exp() 函数

定义和用法

CSS 的 exp() 函数返回自然常数 E 的指定数字 x 次幂(Ex)

自然常数 E(2.718281828459045)是自然对数的底数。

一些例子:

  • exp(0) 表示 1
  • exp(1) 表示 E(2.718281828459045)
  • exp(-∞) 表示 0
  • exp(∞) 表示 ∞

实例

使用 exp() 旋转元素:

div.a {
  transform: rotate(calc(1turn * exp(1)));
}
div.b {
  transform: rotate(calc(1turn * exp(0)));
}
div.c {
  transform: rotate(calc(1turn * exp(-1)));
}
div.d {
  transform: rotate(calc(1turn * exp(-0.90)));
}

亲自试一试

CSS 语法

exp(number)
描述
number 必需。指定 E 的幂次方的数字。

技术细节

版本: CSS4

浏览器支持

表格中的数字表示首个完全支持该函数的浏览器版本。

Chrome Edge Firefox Safari Opera
120 120 118 15.4 106

相关页面

ਸਮਾਧਾਨ:CSS acos() 函数

ਸਮਾਧਾਨ:CSS asin() 函数

ਸਮਾਧਾਨ:CSS atan() 函数

ਸਮਾਧਾਨ:CSS atan2() 函数

ਸਮਾਧਾਨ:CSS calc() 函数

ਸਮਾਧਾਨ:CSS cos() 函数

ਸਮਾਧਾਨ:CSS hypot() 函数

ਸਮਾਧਾਨ:CSS log() 函数

ਸਮਾਧਾਨ:CSS mod() 函数

ਸਮਾਧਾਨ:CSS pow() 函数

ਸਮਾਧਾਨ:CSS sin() 函数

ਸਮਾਧਾਨ:CSS sqrt() ਫੰਕਸ਼ਨ

ਸਮਾਧਾਨ:CSS tan() ਫੰਕਸ਼ਨ