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--简单使用的更多相关文章

  1. Oracle学习(四)_SQL函数

    --第一部分:SQL基础 --ch1 简单查询 --ch2 查询基本概念 --ch3 数据过滤 --第二部分:多表操作 --ch4 集合理论 --ch5 内连接 --ch6 外连接 --ch7 子查询 ...

  2. Oracle学习(二)_多表操作

    --第一部分:SQL基础 --ch1 简单查询 --ch2 查询基本概念 --ch3 数据过滤 --第二部分:多表操作 --ch4 集合理论 --ch5 内连接 --ch6 外连接 --ch7 子查询 ...

  3. Java中简单的操作(if语句、常用操作符、switch语句、变量赋值等)

    ---------------------if语句介绍--------------------------------------------------- class IfDemo { public ...

  4. CF 628C --- Bear and String Distance --- 简单贪心

    CF 628C 题目大意:给定一个长度为n(n < 10^5)的只含小写字母的字符串,以及一个数d,定义字符的dis--dis(ch1, ch2)为两个字符之差, 两个串的dis为各个位置上字符 ...

  5. Android 简单计算器源码....

    PS:今天算是闲着没事做了一个小型的计算器...顺便熟悉一下Android的布局,组件,以及时间监听的方法...就当是做了一个小小的练习吧...     顺便去对比了一下别人写的代码...有的使用到了 ...

  6. HTML标记语言和CSS样式的简单运用(Nineteenth Day)

    曾经励志下去要坚持把每天所学的知识记录下来,可是坚持了几天后,就觉得自己坚持不下去了....这几天自己好好的想了想,觉得不能坚持也得要坚持,因为要对自己负责,所以得学会逼着自己去做,只有这样才能把一件 ...

  7. vuex状态管理,state,getters,mutations,actons的简单使用(一)

    之前的文章中讲过,组件之间的通讯我们可以用$children.$parent.$refs.props.data... 但问题来了,假如项目特别大,组件之间的通讯可能会变得十分复杂... 这个时候了我们 ...

  8. 《objective-c基础教程》学习笔记 (一)—— 开发环境配置和简单类型输出

    懒惰是富有最大的敌人,再不前进,我们就out了.最近工作比较轻松,不是很忙.于是想晚上下班回家学习点新东西.看着苹果大军的一天天壮大,心里也是痒痒的.于是就想先系统的学习下Objective-C,为之 ...

  9. Tornado开发技巧,简单了解tornado

    tornado基础入门(一)——简单了解tornado 参考:http://demo.pythoner.com/itt2zh/ch1.html tornado是一个轻量级的web框架,是一个用pyth ...

  10. 组件之间的通讯:vuex状态管理,state,getters,mutations,actons的简单使用(一)

    之前的文章中讲过,组件之间的通讯我们可以用$children.$parent.$refs.props.data... 但问题来了,假如项目特别大,组件之间的通讯可能会变得十分复杂... 这个时候了我们 ...

随机推荐

  1. spring整合mybatis错误:Caused by: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 62; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "configuration"。

    运行环境:jdk1.7.0_17+tomcat 7 + spring:3.2.0 +mybatis:3.2.7+ eclipse 错误:Caused by: org.xml.sax.SAXParseE ...

  2. Java filter拦截器的使用

    1.web.xml配置 <!-- 验证是否登录 拦截功能 --> <filter> <filter-name>isLogin</filter-name> ...

  3. 在Android上仿百度贴吧客户端Loading图标小球

    封面 前言 使用百度贴吧客户端的时候发发现加载的小动画挺有意思的,于是自己动手写写看.想学习自定义View以及自定义动画的小伙伴一定不要错过哦. 读者朋友需要有最基本的canvas绘图功底,比如画笔P ...

  4. Unity相对于Cocos2d-x的比较

    1.unity:Code in C# or js       cocos:(Code in C++) 2.unity:可以让美工.动画.码农在同一个平台上各司其职(一起玩)       cocos:码 ...

  5. POJ 2449 Dijstra + A* K短路

    这题一开始的思路应该是直接从源点进行BFS搜索K短路. 但这样的复杂度在点数和K的值增大后将会变得很大. 而A*算法则构造一个h(x),在进行BFS时,每次都抛出最小的h(x)从而使汇点的出队速度加快 ...

  6. 基于NIOS-II的示波器:PART3 初步功能实现

    本文记录了在NIOS II上实现示波器的第三部分. 本文主要包括:硬件部分的BRAM记录波形,计算频率的模块,以及软件部分这两个模块的驱动. 本文所有的硬件以及工程参考来自魏坤示波仪,重新实现驱动并重 ...

  7. 团队作业4——第一次项目冲刺(Alpha版本)2017.4.25

    在下午的1,2节软件课程结束后,我们teamworkers全体队员在禹州楼302利用课间时间进行约15分钟的短暂会议,会议的内容为阐述昨天开发遇到的问题,大家都提出自己的看法,最后统一了意见,队员互相 ...

  8. 201521123097《Java程序设计》第五周学习总结

    1. 本周学习总结 1.1 尝试使用思维导图总结有关多态与接口的知识点. 2. 书面作业 1.代码阅读:Child压缩包内源代码 1.1 com.parent包中Child.java文件能否编译通过? ...

  9. 201521123038 《Java程序设计》 第十二周学习总结

    201521123038 <Java程序设计> 第十二周学习总结 1. 本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结多流与文件相关内容. 2. 书面作业 将Student ...

  10. 多线程:head first Thread.join()

    不使用Thread.join() 测试线程 先上代码: /** * Created by Zero on 2017/8/23. */ public class TestJoin implements ...