css3 快速维护
2016-07-17 22:05
302 查看
1.Sass
sass基于ruby,这样的开发模式有点不习惯,需要下次补习。
2.Less
less可以给予node,本次主要介绍内容。
安装
编译
压缩
需要先安装 less-plugin-clean-css
然后压缩
书写例子:
压缩例子:
sass基于ruby,这样的开发模式有点不习惯,需要下次补习。
2.Less
less可以给予node,本次主要介绍内容。
安装
npm install -g less
编译
lessc style.less style.css
压缩
需要先安装 less-plugin-clean-css
npm install -g less-plugin-clean-css
然后压缩
lessc --clean-css style.less style.css
书写例子:
@color:#f9f9f9; @width:100%; @height:100%; @baseFontsize:12px; @headHeight:20px; .container{ width:@width; height:@height; color:@color; font-size:@baseFontsize; } .main{ color:@color + #111; .head{ width:@width; height:@headHeight; .h1{s color:@color; } } .content{a width:@width; height:@height; } .foot{ widht:@width; height:@headHeight*1.5; } }
压缩例子:
.container{width:100%;height:100%;color:#f9f9f9;font-size:12px}.main{color:#fff}.main .head{width:100%;height:20px}.main .head .h1{color:#f9f9f9}.main .content{width:100%;height:100%}.main .foot{widht:100%;height:30px}
相关文章推荐
- CSS3属性教程与案例分享
- CSS3属性教程与案例分享
- CSS3的calc()使用
- 使用CSS3的appearance属性改变元素的外观
- CSS3美化图片
- CSS3质感分析——表面线性渐变
- 分析选项卡底部内凹圆角制作
- 细说百度图片栏目——图片展示效果
- 8个实用的响应式设计框架
- 20+ Animation Scripts, Libraries and Plugins
- 新时代编辑神器:Atom
- more、less 和 most 的区别
- 如何使用CSS3画出一个叮当猫
- 基于Jquery和CSS3制作数字时钟附源码下载(CSS3篇)
- jQuery CSS3相结合实现时钟插件
- CSS3实现动态翻牌效果 仿百度贴吧3D翻牌一次动画特效
- CSS3实例分享之多重背景的实现(Multiple backgrounds)
- 低版本IE正常运行HTML5+CSS3网站的3种解决方案
- CSS3中Transition属性详解以及示例分享
- 基于jQuery和CSS3制作响应式水平时间轴附源码下载