簡單的CSS3滑鼠滑過圖片標題和遮罩層動畫特效

來源:互聯網
上載者:User

標籤:

線上預覽    源碼下載

 使用方法 HTML結構

該滑鼠滑過圖片特效的HTML結構非常簡單:使用一個<div>元素作為圖片遮罩層,在裡面放置圖片的描述資訊。

12345678 <img src="img/01.jpg" alt=""><div class="caption">  <div class="blur"></div>  <div class="caption-text">    <h1>圖片標題</h1>    <p>描述資訊</p>  </div></div>       
 CSS樣式

第一個DEMO使用透明度opacity屬性來製作遮罩層的匯入效果,並通過transition來製作平滑過渡動畫。

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 .caption-style-1 li{  float: left;  padding: 0px;  position: relative;  overflow: hidden;} .caption-style-1 li:hover .caption{  opacity: 1; }.caption-style-1 img{  margin: 0px;  padding: 0px;  float: left;  z-index: 4;}  .caption-style-1 .caption{  cursor: pointer;  position: absolute;  opacity: 0;  -webkit-transition:all 0.45s ease-in-out;  -moz-transition:all 0.45s ease-in-out;  -o-transition:all 0.45s ease-in-out;  -ms-transition:all 0.45s ease-in-out;  transition:all 0.45s ease-in-out; }.caption-style-1 .blur{  background-color: rgba(0,0,0,0.65);  height: 300px;  width: 400px;  z-index: 5;  position: absolute;} .caption-style-1 .caption-text h1{  text-transform: uppercase;  font-size: 24px;}.caption-style-1 .caption-text{  z-index: 10;  color: #fff;  position: absolute;  width: 400px;  height: 300px;  text-align: center;  top:100px;}         

簡單的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.