less使用ch1--简单使用
1 ku.less
.reset(){
*{margin:0;padding:0;}
ul.ol{list-style: none;}
a{text-decoration: none;}
img{border:none;} //ie6
}
/*.clearfix:after{
content:'.';
display: block;
clear:both;
}
.clearfix{zoom:1;}*/
.clearfix(){
&:after{
content:"";
display: block;
clear:both;
}
zoom: 1;
}
.bc(){
margin-left: auto;
margin-right:auto;
}
//浮动
.fl(@dr:left){
float: @dr;
display: inline-block;
}
.fr(@dr:right){
float: @dr;
display: inline-block;
}
.font14(){
font-size:14px;
}
//定位
.pos(r){
position: relative;
}
.pos(a){
position: absolute;
}
.pos(f){
position: fixed;
}
//边框三角 上 右 下 左 相当于js的if
.triangle(bottom, @w:5px, @c:#ccc){ //角朝上
border-width:@w;
border-color:transparent transparent @c transparent;
border-style:dashed dashed solid dashed;
}
.triangle(top, @w:5px, @c:#ccc){ //角朝下
border-width:@w;
border-color:@c transparent transparent transparent;
border-style:solid dashed dashed dashed;
}
.triangle(right, @w:5px, @c:#ccc){ //角朝左
border-width:@w;
border-color:transparent transparent transparent @c;
border-style:dashed dashed dashed solid;
}
.triangle(left, @w:5px, @c:#ccc){ //角朝右
border-width:@w;
border-color:transparent @c transparent transparent;
border-style:dashed solid dashed dashed;
}
.triangle(@_, @w:5px, @c:#ccc){ //@_ 始终都会匹配的,后面两个参数必须加上
width:0px;
height:0px;
overflow: hidden;
}
2 a.css
body{
background-color: #fff;
}
3 主 less
@charset "utf-8"; //引入
@import "ku";
//@import "a.css"; //编译后是 @import "a.css";
@import (less) "a.css"; //会想less一样导入 --注意空格 写在哪就导入到哪 .reset(); @td_width: 616px; //列表总宽度 .tudo-main{
width:@td_width;
}
.title{
@h:62px;
@border_color:#222;
height:@h;
line-height: 62px;
border-top:1px solid @border_color; margin-top:10px; h3{
font-size: 22px;
color:#666;
font-family: "微软雅黑";
font-weight: normal;
font:22px/@h "微软雅黑"; //相当于 font-size和font-family
}
@color:#232323;
&_nav{ //相当于 .title_nav
float: right;
.font14();
color: @color;
li{
float: left;
}
a{
color:@color;
&:hover{
color:red;
}
}
}
} //内容
@item_mr:32px;
.content{
margin-right: -@item_mr;
.pos(r);
.clearfix();
}
.item{
@w:130px;
@h:164px;
@img_h:78px; width:@w;
height:@h;
.fr(left);
margin-right: @item_mr; //item_img
&_img{
height:@img_h;
img{
width:@w;
height:@img_h;
display: block;
}
} //item_list
&_list{
line-height: 22px;
.username,.play,.mess{
padding-left: 17px;
background-repeat: no-repeat;
}
.username{
background-image: url(../img/xxx.jpg);
}
.play{
background-image: url(../img/xxx.jpg);
}
.mess{
background-image: url(../img/xxx.jpg);
}
p{
.triangle(left);
}
}
}
less使用ch1--简单使用的更多相关文章
- Oracle学习(四)_SQL函数
--第一部分:SQL基础 --ch1 简单查询 --ch2 查询基本概念 --ch3 数据过滤 --第二部分:多表操作 --ch4 集合理论 --ch5 内连接 --ch6 外连接 --ch7 子查询 ...
- Oracle学习(二)_多表操作
--第一部分:SQL基础 --ch1 简单查询 --ch2 查询基本概念 --ch3 数据过滤 --第二部分:多表操作 --ch4 集合理论 --ch5 内连接 --ch6 外连接 --ch7 子查询 ...
- Java中简单的操作(if语句、常用操作符、switch语句、变量赋值等)
---------------------if语句介绍--------------------------------------------------- class IfDemo { public ...
- CF 628C --- Bear and String Distance --- 简单贪心
CF 628C 题目大意:给定一个长度为n(n < 10^5)的只含小写字母的字符串,以及一个数d,定义字符的dis--dis(ch1, ch2)为两个字符之差, 两个串的dis为各个位置上字符 ...
- Android 简单计算器源码....
PS:今天算是闲着没事做了一个小型的计算器...顺便熟悉一下Android的布局,组件,以及时间监听的方法...就当是做了一个小小的练习吧... 顺便去对比了一下别人写的代码...有的使用到了 ...
- HTML标记语言和CSS样式的简单运用(Nineteenth Day)
曾经励志下去要坚持把每天所学的知识记录下来,可是坚持了几天后,就觉得自己坚持不下去了....这几天自己好好的想了想,觉得不能坚持也得要坚持,因为要对自己负责,所以得学会逼着自己去做,只有这样才能把一件 ...
- vuex状态管理,state,getters,mutations,actons的简单使用(一)
之前的文章中讲过,组件之间的通讯我们可以用$children.$parent.$refs.props.data... 但问题来了,假如项目特别大,组件之间的通讯可能会变得十分复杂... 这个时候了我们 ...
- 《objective-c基础教程》学习笔记 (一)—— 开发环境配置和简单类型输出
懒惰是富有最大的敌人,再不前进,我们就out了.最近工作比较轻松,不是很忙.于是想晚上下班回家学习点新东西.看着苹果大军的一天天壮大,心里也是痒痒的.于是就想先系统的学习下Objective-C,为之 ...
- Tornado开发技巧,简单了解tornado
tornado基础入门(一)——简单了解tornado 参考:http://demo.pythoner.com/itt2zh/ch1.html tornado是一个轻量级的web框架,是一个用pyth ...
- 组件之间的通讯:vuex状态管理,state,getters,mutations,actons的简单使用(一)
之前的文章中讲过,组件之间的通讯我们可以用$children.$parent.$refs.props.data... 但问题来了,假如项目特别大,组件之间的通讯可能会变得十分复杂... 这个时候了我们 ...
随机推荐
- JAVA 文件编译执行与虚拟机(JVM)简单介绍
详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcytpo3 java程序的内存分配 JAVA 文件编译执行与虚拟机(JVM)介绍 ...
- JDBC(一)之细说JDBC
Properties info = new Properties();//要参考数据库文档 info.setProperty("user", "root"); ...
- Domain Driven Design
在Spring官网的第一个tutorial中看到了这种 设计模式 Domain Driven Design 找到了篇介绍这个得文章: What is Domain Driven Design? &qu ...
- MPLS VPN随堂笔记2
深入理解ospf 理解MPLS VPN 中对OSPF 层次化设计的补充 supper backbone area 2:理解MPLS VPN 中OSPF 的区域设计概念 3:理解MPLS VPN 中OS ...
- 201521123007《Java程序设计》第6周学习总结
1. 本周学习总结 1.1 面向对象学习暂告一段落,请使用思维导图,以封装.继承.多态为核心概念画一张思维导图,对面向对象思想进行一个总结. 2. 书面作业 1. clone方法 1.1 Object ...
- 201521123007《Java程序设计》第1周学习总结
1. 本周学习总结 了解了JAVA语言的发展历史及特点,还有JDK.JRE.JVM三者之间的关系,安装并设置JAVA开发平台,使用Notepad++和Eclipse编辑器编写JAVA程序并运行,学会使 ...
- Android 跳转系统选择本地视频的功能
今天在项目开发的过程中产品要求添加选择本地视频的功能,于是就翻阅和查找各种资料,进行功能的开发,但是在开发过程中发现,各种不同的品牌的手机跳转至系统选择本地视频的功能结果不太一样,所以我就对一些主流的 ...
- 《MySQL必知必会》[01] 基本查询
<MySQL必知必会>(点击查看详情) 1.写在前面的话 这本书是一本MySQL的经典入门书籍,小小的一本,也受到众多网友推荐.之前自己学习的时候是啃的清华大学出版社的计算机系列教材< ...
- Maven:常用命令
1, 将第三方的jar包安装到本地仓库中 mvn install:install-file -Dfile=**/*.jar -DgroupId=XXX -DartifactId=YYY -Dversi ...
- JMeter基础之—录制脚本
Jmeter 是一个非常流行的性能测试工具,虽然与LoadRunner相比有很多不足,比如:它结果分析能力没有LoadRunner详细:很它的优点也有很多: l 开源,他是一款开源的免费软 ...