Understanding mathematical Expressions in CSS Calc ()

Source: Internet
Author: User

Defined

The Mathematical Expression calc () is an abbreviation for the Calculate calculation, which allows the use of + 、-、 *,/These four operators, which can be mixed with%, px, EM, REM, and other units for calculation

Compatibility: ie8-, safari5.1-, ios5.1-, android4.3-not supported, android4.4-4.4.4 only supports addition and subtraction. IE9 not supported for Backround-position

[Note that the]+ and-operators must have a blank character on both sides

650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" Margin:0px;float:left;border:none; "/>


650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" Margin:0px;float:left;border:none; "/>

<div class= "test1" > Test text one </div> <div class= "test2" > Test text two </div>

Application

Mathematical Expressions Calc () is commonly used for numerical operations of different units in layouts

650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" Margin:0px;float:left;border:none; "/>

<style>p{margin:0;}. Parent{overflow:hidden;zoom:1;}.    left{float:left;width:100px;margin-right:20px;} . Right{float:left;width:calc (100%-120px);} </style>

650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" Margin:0px;float:left;border:none; "/>

650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" Margin:0px;float:left;border:none; "/>

<div class= "Parent" style= "Background-color:lightgrey;" > <div class= "left" style= "Background-color:lightblue;" > <p>left</p> </div> <div class= "right" style= "Background-color:lightgreen;" > <p>right</p> <p>right</p> </div></div>

650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" Margin:0px;float:left;border:none; "/>



Understanding mathematical Expressions in CSS Calc ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.