鍍金池/ 問答/HTML/ 為什么加了transition沒有作用

為什么加了transition沒有作用

clipboard.png

.transition {
  -webkit-transition: all .5s ease 0s;
  transition: all .5s ease 0s;
  -moz-transition: all .5s ease 0s;
  -o-transition: all .5s ease 0s;
}

  .item-wrapper {
    margin: 0 10px;
    border-radius: 12px;
    box-shadow: 0 0 27px rgba(0, 93, 208, .27);
    border: 1px solid #3380e7;
    padding: 50px 25px;
    .hb {
      position: relative;
      margin-bottom: 30px;
      .normal, .active {
        display: flex;
        align-items: center;
        img {
          width: 80px;
          padding-right: 20px;
        }
        h4 {
          flex: 2;
        }
      }
      .active {
        opacity: 0;
        position: absolute;
        top: 0;
      }
    }
  }
  .item-wrapper:hover {
    background: linear-gradient(90deg, #3977e2, #13a9ff);
    .ft {
      color: #fff;
    }
  }

但是現(xiàn)在hover沒有過度效果

回答
編輯回答
尐潴豬

transition 不支持 linear-gradient ?

2017年9月1日 13:18
編輯回答
過客

你可以試試把.transition改成.transition:hover試試,我感覺可能是因為直接加的class而不是加hover偽類導(dǎo)致的hover沒有效果。

2017年7月16日 22:47
編輯回答
情殺
.item-wrapper 或者.transition 再加個屬性background:none就行了
2017年6月27日 19:20