📜  CSS 百分比减去 px - CSS 代码示例

📅  最后修改于: 2022-03-11 14:48:01.050000             🧑  作者: Mango

代码示例1
You can use calc:

height: calc(100% - 18px);
Note that some old browsers don't support the CSS3 calc() function, so implementing the vendor-specific versions of the function may be required:

/* Firefox */
height: -moz-calc(100% - 18px);
/* WebKit */
height: -webkit-calc(100% - 18px);
/* Opera */
height: -o-calc(100% - 18px);
/* Standard */
height: calc(100% - 18px);