transform 中含有 position: fixed 失效的问题解决

今天爱分享给大家带来transform 中含有 position: fixed 失效的问题解决,希望能够帮助到大家。
话不多说,直接上代码!!!

原代码是这样的

.down-icon {
    width: .27rem;
    height: 0.27rem;
    border-top: .02rem solid #6D3942;
    border-left: .02rem solid #6D3942;
    transform: rotate(45deg);
    position: fixed;
    left: 0;
    bottom: 0.4rem;
    left: 0;
    right: 0;
    margin: auto;
}

结果没有任何反应,其中的transform: rotate(45deg);并没有管用

解决办法:


position: fixed;放在父元素内,添加一个子元素transform: rotate(45deg);放在子元素内

.down-icon {
    width: .27rem;
    height: 0.27rem;
    position: fixed;
    left: 0;
    bottom: 0.4rem;
    left: 0;
    right: 0;
    margin: auto;
    i{
      display: block;
      width: 100%;
      height: 100%;
      border-top: .02rem solid #6D3942;
      border-left: .02rem solid #6D3942;
      transform: rotate(45deg);
    }
}

此时效果可以实现

 

原文链接:https://blog.itblood.com/460.html,转载请注明出处。
0
河原崎家的一族2 AI汉化版+全CG存档[新汉化][FM/2.5G/百度] (河原崎家の一族2) [史诗ADV/汉化]
河原崎家的一族2 AI汉化版+全CG存档[新汉化][FM/2.5G/百度] (河原崎家の一族2) [史诗ADV/汉化]
5分钟前 有人购买 去瞅瞅看

站点公告

显示验证码
没有账号?注册  忘记密码?