Home >Web Front-end >CSS Tutorial >Introduction to the responsive mode layout method using calc() in CSS3

Introduction to the responsive mode layout method using calc() in CSS3

巴扎黑
巴扎黑Original
2017-09-07 09:13:261911browse

This article mainly introduces the implementation method of CSS3's calc() for responsive mode layout. Friends in need can refer to

REM method

calc( ) Literally we can understand it as a function function. In fact, calc is the abbreviation of the English word calculate. It is a new function of CSS3 and is used to specify the length of elements. For example, you can use calc() to set dynamic values ​​for the border, margin, padding, font-size, and width properties of an element. Why is it called a dynamic value? Because we use expressions to get the value. However, the biggest benefit of calc() is that it can be used in fluid layout. The width of the element can be calculated through calc().

calc() allows you to calculate the element. You can give a p element and calculate its width or height using percentage, em, px and rem unit values, such as "width: calc(50% + xxpx)", so that you don't have to consider the width value of element p, and leave this annoying task to the browser to calculate.


width:calc(50% + xxpx)

The above is the detailed content of Introduction to the responsive mode layout method using calc() in CSS3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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