Skip to content

CSS3的calc()函数使用 #59

Open
@youngjuning

Description

@youngjuning

CSS函数calc()可以用在任何一个需要<length><frequency>, <angle><time><number>、或<integer>的地方。有了calc(),你就可以通过计算来决定一个CSS属性的值了。

你还可以在一个 calc() 内部嵌套另一个 calc() ,里面的 calc() 会被简单地视为加了括号。

语法

注意,运算符两头都需要有空格

/* property: calc(expression) */
width: calc(100% - 80px);

兼容性

点击查看:https://caniuse.com/#search=calc

Metadata

Metadata

Assignees

Labels

css3css最复杂

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions