您现在的位置是:网站首页> 编程资料编程资料
html+css实现响应式卡片悬停效果CSS3防疫知识图文响应式布局代码CSS3响应式个人名片图文布局代码详解CSS3实现响应式手风琴效果css3 响应式媒体查询的示例代码HTML5 图片悬停放大的实现代码示例html用title属性实现鼠标悬停显示文字
2023-10-08
439人已围观
简介 这篇文章主要介绍了 html+css实现响应式卡片悬停效果,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
话不多,看效果先:

卡片悬停,响应式卡片,简约效果。
实现:
1. 定义标签,.kapian为最底层盒子,然后两个子盒子一个放图片,一个放文本:
The aurora borealis
natural
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.
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; }完整代码:
Document The aurora borealis
natural
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.
总结:
希望在路上~

到此这篇关于 html+css实现响应式卡片悬停效果的文章就介绍到这了,更多相关html css卡片悬停内容请搜索以前的文章或继续浏览下面的相关文章,希望大家以后多多支持!
相关内容
- html解决table设置宽度无效的问题HTML页面自适应宽度的table(表格)固定 table宽度 table-layout: fixed表格设置table-layout:fixed后对单元格宽度设置无效html中table为每个单元格设置不同颜色和宽度设置table中的宽度不随文字改变让其固定td 内容自动换行 table表格td设置宽度后文字太多自动换行html table呈现个人简历以及单元格宽度失效的问题解决
- html+css实现充电水滴融合特效代码html+css实现图片扫描仪特效 html+css实现血轮眼轮回眼特效代码
- 在HTML中限制input 输入框只能输入纯数字的实现纯html+css实现Element loading效果纯html+css实现奥运五环的示例代码HTML+CSS实现导航条下拉菜单的示例代码html+css实现滚动到元素位置显示加载动画效果纯html+css实现打字效果html+css实现环绕倒影加载特效html输入两个数实现加减乘除功能html中显示特殊符号(附带特殊字符对应表)关于html选择框创建占位符的问题html css3不拉伸图片显示效果
- HTML中div嵌套div的margin不起作用的解决方法html中使用margin:0 auto整个页面不居中的解决方法HTML和CSS的关键:盒子模型(Box model)-CSS教程-网页制作-网页教学网HTML教程,HTML默认样式
- 一分钟带你体验html+vue+element-ui的丝滑html直接引用vue和element-ui的方法
- 疯狂猜发型两个字的游戏答案大全_手机游戏_游戏攻略_
- 疯狂猜发型三个字的游戏答案大全 _手机游戏_游戏攻略_
- 天天酷跑刷金币40W 一局教程分享_手机游戏_游戏攻略_
- NBA2k14球员最新名单大全_手机游戏_游戏攻略_
- NBA 2K14跳过注册时间界面的操作方法具体步骤_手机游戏_游戏攻略_

