css3實現小米商城滑鼠移動圖片上浮陰影製作效果

來源:互聯網
上載者:User

標籤:chrome   color   :hover   png   nts   device   html   neu   src   

今天在編程愛好者編碼庫看見一個好玩的程式,代碼如下。

<!DOCTYPE html><html><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">    <meta name="renderer" content="webkit">     <title>CSS3實現小米商城滑鼠移動圖片上浮陰影製作效果</title>    <style>        *{margin: 0;padding: 0;font-family: ‘微軟雅黑‘,‘Helvetica Neue‘, Arial, sans-serif}        body{            background-color: #f5f5f5;            text-align: center;        }         .image-shadow{            position:relative;  /*設定為相對*/            margin: 60px auto;            z-index: 1;            width: 294px;            height: 413px;            background: #fff;            -webkit-transition: all .2s linear; /*漸層效果*/            transition: all .2s linear;        }                 .image-shadow:hover{            z-index: 2; /*設定在頂層顯示*/            -webkit-box-shadow: 0 15px 30px rgba(0,0,0,0.1);    /*添加陰影*/            box-shadow: 0 15px 30px rgba(0,0,0,0.1);            -webkit-transform: translate3d(0, -2px, 0);     /*向上浮動*/            transform: translate3d(0, -2px, 0);        }             </style></head><body> <h3 style="margin: 60px 0 20px 0; text-align: center">CSS3實現小米商城滑鼠移動圖片上浮陰影製作效果</h3> <div class="image-shadow">    <img src="http://i1.piimg.com/1949/b5f249822d378888.png"></div> </body></html>

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.