utils->css->features功能函数

本文介绍了前端开发中的一些实用技巧,包括清除浮动以解决布局问题,修复IE浏览器中FontAwesome图标不显示的解决方案,禁止用户选中文本以及创建鼠标悬停时元素跟随的hover效果。这些技巧对于提升网页交互性和用户体验至关重要。
摘要由CSDN通过智能技术生成
// 功能
// 1.去除浮动,高度缺失---------------------------------------
.clearfix {
  &:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
  }
}

// 2.ie浏览器中Font Awesome图标不显示----------------------------
// .el­icon­date:before {
//   content: "\e78e";
// }

// .el­icon­date {
// *zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '&#e78e;');
// }

// 3.禁止用户选中----------------------------
// .banToSelect{
//   -webkit-user-select: none;
//   -moz-user-select: none;
//   -khtml-user-select: none;
//    user-select: none;
// }


// 4.hover鼠标跟随----------------------------
@function randomNum($max, $min: 0, $u: 1) {
  @return ($min + random($max)) * $u;
}

.mouse-following {
  display: flex;
  overflow: hidden;
  flex-wrap: wrap;
  height: 100%;
  cursor: pointer;

  li {
    position: relative;
    width: 30px;
    height: 30px;

    &::before {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      border-radius: 100%;
      background-color: transparent;
      content: "";
      transform: scale3d(.1, .1, 1);
      transition: all 500ms ease-in;
    }

    &:hover {
      &::before {
        transform: scale3d(1.8, 1.8, 1.8);
        transition: transform 0s;
      }
    }

    @for $i from 1 through 500 {
      &:nth-child(#{$i}):hover {
        &::before {
          background-color: rgba(randomNum(255), randomNum(255), randomNum(255), .8);
        }
      }
    }
  }
}


// 5.模拟视差滚动----------------------------


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值