兴国资源网 Design By www.nnzcdc.com
话不多,看效果先:
卡片悬停,响应式卡片,简约效果。
实现:
1. 定义标签,.kapian为最底层盒子,然后两个子盒子一个放图片,一个放文本:
<div class="kapian"> <div class="tu"> <img src="3.2.png"> </div> <div class="wenben"> <h2>The aurora borealis</h2> <p style="padding-bottom: 20px;">natural</p> <p> Aurora Borealis is a colorful luminous phenomenon that appears over the high magnetic latitude region of the planet's North Pole. I love the aurora borealis. It's so beautiful. </p> </div> </div>
2.先定义底层盒子的css基本样式,长宽等,就不详细说明了:
.kapian{ position: relative; width: 300px; height: 400px; border-radius: 3px; background-color: #fff; box-shadow: 2px 3px 3px rgb(139, 138, 138); overflow: hidden; cursor: pointer; transition: all 0.3s; } .kapian:hover{ box-shadow: 2px 3px 10px rgb(36, 35, 35); }
:hover鼠标经过后盒子阴影变化。
transition: all 0.3s;过渡效果,阴影在0.3s内慢慢变化
3. 图片的基本样式,采用绝对定位:
.tu{ position: absolute; top: 0; left: 0; width: 100%; height: 300px; overflow: hidden; } .tu img{ width: 100%; height: 100%; transition: all 0.5s; } .kapian:hover .tu img{ transform: scale(1.2); filter: blur(1px); }
:hover鼠标经过后图片变大,而且变模糊;
transform: scale(1.2);图片变大为1.2倍;
filter: blur(1px);图片变模糊;
4 .定义装文本这个盒子的基本样式,采用绝对定位:
.wenben{ position: absolute; bottom: -200px; width: 100%; height: 300px; background-color: rgb(247, 242, 242); transition: 0.5s; } .kapian:hover .wenben{ bottom: 0px; }
:hover鼠标经过后文本框绝对定位的bottom发生改变,使得呈现文本框向上展开的效果;
5 .文本框里字符的样式:
.wenben h2{ color: rgb(21, 74, 172); line-height: 60px; text-align: center; } .wenben p{ padding: 0 30px; font-family: 'fangsong'; font-size: 16px; font-weight: bold; line-height: 20px; text-align: center; }
完整代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> *{ margin: 0; padding: 0; box-sizing: border-box; } body{ height: 100vh; display: flex; justify-content: center; align-items: center; background-image: radial-gradient(rgb(241, 238, 238),black); } .kapian{ position: relative; width: 300px; height: 400px; border-radius: 3px; background-color: #fff; box-shadow: 2px 3px 3px rgb(139, 138, 138); overflow: hidden; cursor: pointer; transition: all 0.3s; } .kapian:hover{ box-shadow: 2px 3px 10px rgb(36, 35, 35); } .tu{ position: absolute; top: 0; left: 0; width: 100%; height: 300px; overflow: hidden; } .tu img{ width: 100%; height: 100%; transition: all 0.5s; } .kapian:hover .tu img{ transform: scale(1.2); filter: blur(1px); } .wenben{ position: absolute; bottom: -200px; width: 100%; height: 300px; background-color: rgb(247, 242, 242); transition: 0.5s; } .kapian:hover .wenben{ bottom: 0px; } .wenben h2{ color: rgb(21, 74, 172); line-height: 60px; text-align: center; } .wenben p{ padding: 0 30px; font-family: 'fangsong'; font-size: 16px; font-weight: bold; line-height: 20px; text-align: center; } </style> </head> <body> <div class="kapian"> <div class="tu"> <img src="3.2.png"> </div> <div class="wenben"> <h2>The aurora borealis</h2> <p style="padding-bottom: 20px;">natural</p> <p> Aurora Borealis is a colorful luminous phenomenon that appears over the high magnetic latitude region of the planet's North Pole. I love the aurora borealis. It's so beautiful. </p> </div> </div> </body> </html>
总结:
希望在路上~
兴国资源网 Design By www.nnzcdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
兴国资源网 Design By www.nnzcdc.com
暂无评论...
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。
更新日志
2024年05月02日
2024年05月02日
- 任洁玲.1995-我们有没有爱过【飞碟】【WAV+CUE】
- 海来阿木《西楼情歌》1:1母版直刻[320K/MP3][139.61MB]
- 海来阿木《西楼情歌》1:1母版直刻[FLAC/分轨][344.97MB]
- 群星《影视剧 群星闪耀时 影视原声带》[320K/MP3][38.69MB]
- 姜育恒.1998-成名金曲(马来西亚瑞华金碟珍藏版)【瑞华】【WAV+CUE】
- 水木年华.2006-生命狂想曲特别版2CD【水木同创】【WAV+CUE】
- 卢庚戌.2000-未来的未来【喜洋洋】【WAV+CUE】
- 钟汉良.1997-亲热【艺能动音】【WAV+CUE】
- 满文军.2002-我需要你【新索音乐】【WAV+CUE】
- 毛阿敏.2000-毛阿敏·精选集【中唱】【WAV+CUE】
- 钟明秋《爱有天意HQ》头版限量[低速原抓WAV+CUE]
- 云飞《云在飞HQ》头版限量编号[低速原抓WAV+CUE]
- 戏班-就是这个调调【FLAC分轨】
- 黄品源《寂寞旋律》[WAV+CUE][367M]
- 群星《家传户晓~我们三十年的主题曲XRCD》[WAV分轨][532M]