频道栏目
首页 > 资讯 > HTML/CSS > 正文

less使用小结

18-08-01        来源:[db:作者]  
收藏   我要投稿

编译 background缩写加e(‘/’)

background: url(../img/dial-del.png) 0 0 e('/') 24px 16px no-repeat;

less的继承

@import "variable.less";

less写mixin方法

.bg-image(@url) {
  background-image: url("@{url}@2x.png");

  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and (     -o-min-device-pixel-ratio: 2/1),
  only screen and (        min-device-pixel-ratio: 2),
  only screen and (                min-resolution: 192dpi),
  only screen and (                min-resolution: 2dppx) {
    background-image: url("@{url}@3x.png");
  }
}

.no-wrap(){
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}


.extend-click(){
  position: relative;
  &:before{
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
}

}

调用方法

.bg-image('./../image/logo');
相关TAG标签
上一篇:关于mysql日期函数date_format(date,format)的使用解析
下一篇:MySql Sharding分表、分库、分片和分区知识讲解
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站