1)第一种实现方式

    @body_center_width:  ~`$(document).width()-400+'px'`;  

    #helloworld {
width: @body_center_width;
height: 200px;
background: #000;
}
    @height: ~`document.body.clientWidth-400+'px'`;
#box { height:200px; width:@height; background:#080; opacity:@height; }

2)第二种实现方式

    /** 1)收缩CSS代码 **/
.box{
border:1px solid #ddd;
width:calc(100%-2px)
} /** 2)宽度,10em加20px。 **/
-收缩CSS代码
.box{
width:calc(10em+20px)
} /** 3)3栏等宽布局。 **/
-收缩CSS代码
.box{
margin-left:20px;
width:calc(100%/3-20px);
}
.box:nth-child(3n){
margin-left:;
}

高级运算式

    -收缩CSS代码
width:calc(100%/3 - 2*1em - 2*1px); 这样写也是可以的:
-收缩CSS代码
width:calc(100% / 3 - 2 * 1em - 2 * 1px); 但是这样写就是错的:
-收缩CSS代码
width:calc(100%/3-2*1em-2*1px);

最新文章

  1. ZHA profile与ZLL profile的一个例子
  2. python数据类型和字符串(三)
  3. Android之旅---广播(BroadCast)
  4. MySQL 数据库设计 笔记与总结(3)物理设计
  5. 第九篇 Integration Services:控制流任务错误
  6. 刻通云KeyTone Cloud测试
  7. 通过find命令寻找文件并拷贝到一个指定目录方法详解
  8. PAT1005—— 继续(3n+1)猜想
  9. shell脚本练习(autocert)
  10. 说说关于php内置函数curl_init()
  11. flash导入图片缩放后出现毛边、失真、锯齿、文字模糊不清晰的情况
  12. MySQL源码安装(centos)
  13. JavaScript返回上一页并自动刷新
  14. 【JQUERY】插件的写法
  15. JButton
  16. 2、Android构建本地单元测试
  17. spring注解关键字
  18. Jmeter初步
  19. matlab-画个拱桥和倒影?
  20. bash shell执行方式

热门文章

  1. 【nodejs代理服务器四】代理服务器增加频繁访问的ip加入黑名单
  2. python之反射机制与callattr()、issubclass()、isinstance、type()相关
  3. 记录java+testng运行selenium(四)--- 结构说明
  4. IP地址的总结
  5. Anaconda基础使用
  6. Ubuntu apt-get锁定问题
  7. Ubuntu armhf 版本国内源
  8. Robot Framework--接口测试中常见的四种POST方式
  9. 优化你的HTTPS(上),你需要这么做
  10. 0、Python学习路线