What is the usage of calc in css3

WBOY
Release: 2022-05-23 20:47:14
Original
2279 people have browsed it

In CSS3, the calc() function is used to dynamically calculate the length value. The parameter can be set to a mathematical expression, and the result will be the return value after the operation; any length value can use the calc() function Calculations are performed, using standard mathematical precedence rules, with the syntax "length attribute: calc (length mathematical expression)".

What is the usage of calc in css3

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

What is the usage of calc in css3

The calc() function is used to dynamically calculate the length value.

It should be noted that a space needs to be reserved before and after the operator, for example: width: calc(100% - 10px);

Any length value can be calculated using the calc() function ;

The calc() function supports " ", "-", "*", "/" operations;

The calc() function uses standard mathematical operation priority rules;

The syntax is:

calc(expression)
Copy after login

expression Required, a mathematical expression, the result will be the return value after the operation.

The example is as follows:

    123  

创建一个横跨屏幕的div,div 两边有 50px 的间隙:

一些文本...
Copy after login

Output result:

What is the usage of calc in css3

(Learning video sharing:css video tutorial)

The above is the detailed content of What is the usage of calc in css3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!