一款基於css3非常實用的滑鼠移至上方特效

來源:互聯網
上載者:User

標籤:style   blog   http   io   color   ar   os   for   sp   

今天給大家帶來一款基於css3非常實用的滑鼠移至上方特效。這款特效,當滑鼠經過時候一個半透明的遮罩層倒下來。效果很好,而且是純css3實現的,代碼很少,非常實用。 效果如下:

線上預覽   源碼下載

實現的代碼:

html代碼:

 <div align="center" style="position: relative;">        <div class="contener">            <div class="txt_init">                LOW POLY BACKGROUND</div>            <div class="opac">                Download</div>        </div>    </div>

css3代碼:

  .contener{  width:310px;  height:140px;  background-image:url(fond.png);  overflow: hidden;  cursor: pointer;  position:relative;}.txt_init{  position: absolute;  bottom: 5px;  right: 5px;  font-family: ‘Roboto‘;  font-size: 22px;  color: #ffffff;  font-weight: 500;}.opac{  opacity: 0;}.contener:hover .opac{  width:310px;  position: absolute;  z-index: 1;  font-family: ‘Roboto‘;  font-size: 25px;  color: #ffffff;  font-weight: 300;  line-height: 140px;  height:140px;  opacity: 1;  background-color: rgba(0,0,0,0.7);  -webkit-animation:oblik 0.4s ease-in;  -webkit-transform-origin: 0% 100%;  -moz-animation:oblik 0.4s ease-in;  -moz-transform-origin: 0% 100%;  -ms-animation:oblik 0.4s ease-in;  -ms-transform-origin: 0% 100%;  animation:oblik 0.4s ease-in;  transform-origin: 0% 100%;  }@-webkit-keyframes oblik {  0% {opacity:0;-webkit-transform: rotate(-45deg);}  100% {opacity:1;-webkit-transform: rotate(0deg);}   }@-moz-keyframes oblik {  0% {opacity:0;-moz-transform: rotate(-45deg);}  100% {opacity:1;-moz-transform: rotate(0deg);}   }@-ms-keyframes oblik {  0% {opacity:0;-ms-transform: rotate(-45deg);}  100% {opacity:1;-ms-transform: rotate(0deg);}   }@keyframes oblik {  0% {opacity:0;transform: rotate(-45deg);}  100% {opacity:1;transform: rotate(0deg);}   }

註:本文愛編程原創文章,轉載請註明原文地址:http://www.w2bc.com/Article/9986

一款基於css3非常實用的滑鼠移至上方特效

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.