css3 實(shí)現(xiàn)鼠標(biāo)移入文字下滑動(dòng)畫效果

效果圖展示:
鼠標(biāo)移入,文字動(dòng)畫.gif

css

.wrap{
  width: 250px;
  height: 250px;
  overflow:hidden;
  position: relative;
}
.txt{
  position: absolute;
  width: 250px;
  height: 250px;
  top:-250px;
  background:rgba(0,0,0,0.5);
}
.img img{
  width: 100%;
}
.wrap,.txt{
  transition: all .5s;
  cursor: pointer;
}
.wrap:hover .txt{
  top:0;
}

html

<div class="wrap">
  <div class="txt">
    我是親愛噠問嗎可是怕拉風(fēng)阿斯達(dá)發(fā)噶實(shí)打?qū)崋?,愛?  </div>
  <div class="img">
    <img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3502659583,3709665526&fm=26&gp=0.jpg" alt="" >
  </div>
</div>

如果是從下往上

.txt{
  position: absolute;
  width: 250px;
  height: 250px;
  bottom:-250px;
  background:rgba(0,0,0,0.5);
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容