純css3滑鼠經過圖片顯示描述特效

來源:互聯網
上載者:User

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

今天給大家帶來的是用css3技術實現滑鼠經過圖片,顯示圖片描述的動畫效果。滑鼠經過圖片時,圖片動畫縮小並漸層顯示描述。我們一起看看:

 

線上預覽   源碼下載

 

我們一起學習下此案例的代碼。

html代碼:

<div align="center">        <div class="carre_couleur base_hov" style="background-color: #f8b334;">            <a target="_blank" href="http://www.w2bc.com">                <div class="retract" style="background-color: #f8b334;">                    <img src="img/1.png"></div>                <div class="acced">                    <div class="big_acced" style="color: #f39c12;">                        BEST HOME</div>                    <div class="middle_acced">                        This home is the best</div>                </div>            </a>        </div>        <div class="carre_couleur base_hov" style="background-color: #2ecc71;">            <a target="_blank" href="http://www.w2bc.com">                <div class="retract" style="background-color: #2ecc71;">                    <img src="img/2.png"></div>                <div class="acced">                    <div class="big_acced" style="color: #27ae60;">                        BEST PIC</div>                    <div class="middle_acced">                        This pic is the best</div>                </div>            </a>        </div>        <div class="carre_couleur base_hov" style="background-color: #e74c3c;">            <a target="_blank" href="http://www.w2bc.com">                <div class="retract" style="background-color: #e74c3c;">                    <img src="img/3.png"></div>                <div class="acced">                    <div class="big_acced" style="color: #c0392b;">                        BEST PC</div>                    <div class="middle_acced">                        This computer is the best</div>                </div>            </a>        </div>
View Code

css3代碼:

      .carre_couleur        {            width: 200px;            height: 200px;            display: inline-block;            position: relative;            margin-top: 0px;        }        .base_hov .retract        {            -webkit-transition: all 200ms ease-in;            -webkit-transform-origin: 50% 20%;            -webkit-transform: scale(1);            -moz-transition: all 200ms ease-in;            -moz-transform-origin: 50% 20%;            -moz-transform: scale(1);            -ms-transition: all 200ms ease-in;            -ms-transform-origin: 50% 20%;            -ms-transform: scale(1);            transition: all 200ms ease-in;            transform-origin: 50% 20%;            transform: scale(1);            width: 200px;            height: 200px;            position: absolute;            z-index: 2;            left: 0;        }        .base_hov:hover .retract        {            -webkit-transition: all 200ms ease-in;            -webkit-transform: scale(0.6);            -moz-transition: all 200ms ease-in;            -moz-transform: scale(0.6);            -ms-transition: all 200ms ease-in;            -ms-transform: scale(0.6);            transition: all 200ms ease-in;            transform: scale(0.6);        }        .acced        {            width: 180px;            padding: 10px;            bottom: 0;            position: absolute;            z-index: 1;            text-align: left;        }        .big_acced        {            color: #ffffff;            font-size: 25px;            font-weight: 400;        }        .middle_acced        {            color: #ffffff;            font-size: 15px;            font-weight: 400;        }
View Code

複製上面的代碼到你的html試試效果吧。

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

純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.