小笔记2

1、css     (标红的可以实现滚动效果,并且每次push到selected中的元素在可视范围右侧显示)

.filterSelected{
  width:100%;
  height:45*@xem;
  line-height:45*@xem;
  background:#f5f5f5;
  color:#bbbbbb;
  text-align:center;
  z-index:1;
  position:relative;
  .selected{
    padding-left:10*@xem;
overflow-x: auto; //控制横向滚动
    overflow-y: hidden;
    white-space: nowrap;            //不换行,滚动    
    position: absolute;             //控制元素在可视范围右侧    
    right: 0;
    text-align:left;               //元素个数总宽度小于100%;居左显示
min-width: 100%;
    span{      
        border:1px solid #ccc;      
        padding:0 20*@xem 0 5*@xem;      
        height:24*@xem;      
        line-height:24*@xem;      
        background:#fff;     
        color:#333;      
        display:inline-block;      
        margin-right:5*@xem;     
        position:relative;      
        &:after{        
            content:'';        
            background: url("../../img/close.png") no-repeat center center;        
            background-size:cover;        
            width:10*@xem;        
            height:10*@xem;        
            display: inline-block;        
            position:absolute;       
            top:7*@xem;        
            right:5*@xem;      
        }    
      }  
   }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值