游標滑過圖片說明文字區塊從下往上滑入
游標滑過圖片時,說明文字區塊從下往上滑入
效果演示:
HTML:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>滑過圖片說明文字區塊從下往上滑入</title>
<link rel="stylesheet" href="style.css">
</head>
<body id="dailycss_20210725">
<div class="imageBox">
<img src="https://i.imgur.com/DR2Z8i0.png" alt="紫龍要戳眼睛了">
<div class="textBox">
<p>
一步期待訂單財經近日我只羅東都要傳說減肥我很不願意過了,即使投資者臨床不怕那時聽到即使沒有機制一個毫不,非常相同收購那天上午初步歌詞球員關鍵。
</p>
</div>
</div>
</body>
</html>
CSS:
#dailycss_20210725 { margin: 0; padding: 0; background: #1c363e; } #dailycss_20210725 .imageBox { width: 360px; height: 343px; position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); background: #000; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 25px rgba(0, 0, 0, 0.5); } #dailycss_20210725 .imageBox img { width: 100%; height: 100%; transition: .5s; } #dailycss_20210725 .imageBox .textBox { position: absolute; left: 0; bottom: -100%; width: 100%; height: 100%; background-color: #7986cb; box-sizing: border-box; padding: 10px; transition: .5s; } #dailycss_20210725 .imageBox .textBox p { font-size: 16px; line-height: 24px; } #dailycss_20210725 .imageBox:hover .textBox { bottom: -60%; } #dailycss_20210725 .imageBox:hover .img { transform: translateY(-40%); }
來源:
迴響列表
目前還沒有任何留言
留言表單