css3 鼠标悬停图片动画
时间:2019-09-19
本文章向大家介绍css3 鼠标悬停图片动画,主要包括css3 鼠标悬停图片动画使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
<div class="grid"> <figure class="effect-milo"> <img src="img/3.jpg"/> <figcaption> <h2>Faithful <span>Milo</span></h2> <p>Milo went to the woods. He took a fun ride and never came back.</p> </figcaption> </figure> </div>
.effect-milo{ overflow: hidden; backface-visibility: hidden; float: left; margin: 0; width: 480px; height: 360px; margin-right: 55px; position: relative; cursor: pointer; background: #2e5d5a; } .effect-milo img{ /*width: 100%;*/ height: 100%; width: calc(100% + 30px); transform: translate3d(-30px,0,0); -webkit-transform: translate3d(-30px,0,0); -webkit-transition: opacity 0.35s, -webkit-transform 0.35s; transition: opacity 0.35s,transform 0.35s; backface-visibility: hidden; } .effect-milo figcaption{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; text-align: center; } .effect-milo figcaption h2{ position: absolute; top: 74%; left: 20%; width: 100%; height: 100%; font-size: 30px; font-weight: 400; text-transform: uppercase; } .effect-milo figcaption span{ font-weight: 600; } .effect-milo figcaption p{ position: absolute; top: 10%; left: 10%; width: 40%; text-align: right; border-right: 1px solid #fff; padding-right: 10px; transform: translate3d(-30px,0,0); -webkit-transform: translate3d(-30px,0,0); transition: opacity 0.35s,transform 0.35s; -webkit-transition: opacity 0.35s,transform 0.35s; opacity: 0; } .effect-milo:hover img { transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0); opacity: .6; } .effect-milo:hover p{ transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0); opacity: 1; }
效果图
原图
鼠标悬浮效果
<div class="grid"> <figure class="effect-chico"> <img src="img/15.jpg"/> <figcaption> <h2>Silly <span>Chico</span></h2> <p>Chico's main fear was missing the morning bus.</p> </figcaption> </figure> </div>
.effect-chico{ overflow: hidden; backface-visibility: hidden; float: left; margin: 0; width: 480px; height: 360px; margin-right: 55px; position: relative; cursor: pointer; background: #3085a3; } .effect-chico img{ width: 100%; height: 100%; -webkit-transition: opacity 0.35s, -webkit-transform 0.35s; transition: opacity 0.35s, transform 0.35s; -webkit-transform: scale(1.12); transform: scale(1.12); } .effect-chico figcaption{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; text-align: center; } .effect-chico figcaption h2{ position: absolute; top: 23%; left: 0; width: 100%; height: 100%; font-size: 30px; font-weight: 400; text-transform: uppercase; } .effect-chico figcaption span{ font-weight: 600; } .effect-chico figcaption p{ position: absolute; top: 39%; left: 25%; width: 50%; opacity: 0; -webkit-transition: opacity 0.35s, -webkit-transform 0.35s; transition: opacity 0.35s,transform 0.35s; -webkit-transform: scale(1.5); transform: scale(1.5); } .effect-chico figcaption:after{ content: ''; position:absolute; top: 30px; bottom: 30px; left: 30px; right: 30px; border:1px solid #fff; opacity: 0; -webkit-transition: opacity 0.35s, -webkit-transform 0.35s; transition: opacity 0.35s,transform 0.35s; -webkit-transform: scale(1.1); transform: scale(1.1); } .effect-chico:hover img{ opacity: .7; -webkit-transform: scale(1); transform: scale(1); } .effect-chico:hover p, .effect-chico:hover figcaption:after{ opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
原图
鼠标悬浮效果图
原文地址:https://www.cnblogs.com/yhhBKY/p/11550620.html
- jQuery和asp.net mvc相关资源链接
- JavaScriptSerializer 序列化json 时间格式
- Nginx反向代理+负载均衡简单实现(https方式)
- 在网页中给Flash加上超级链接
- ASP.NET MVC HandleErrorAttribute 和 远程链接
- javascript实现数字转大写金额的函数
- 如何在GridView的Footer内显示总计?
- 自定义WCF的配置文件
- Centos中动态扩容lvm逻辑卷的操作记录
- Visual Round Trip Analyzer
- ASP.NET可以在Windows Server 2008 R2 Server Core上运行
- SOA十大设计原则
- 中国人民大学文继荣:大数据的经验主义解释
- 检查Python对象
- HTML 教程
- HTML 简介
- html div 标签介绍
- html span 标签介绍
- html a 超链接标签
- HTML Br换行标签介绍
- HTML P段落标签介绍
- HTML br与p标签区别
- Html H 标题标签
- html px em pt长度单位
- HTML form 标签
- HTML radio 单选框
- HTML B 加粗标签
- HTML strong加粗粗体标签
- HTML em 强调标签
- HTML i 斜体标签
- HTML u下划线标签
- HTML s 删除线标签
- Html img 图片标签
- Html上标注sup与下标注sub标签
- HTML nobr 禁止换行标签
- HTML hr 水平线标签
- HTML label 标签
- HTML input 标签
- HTML textarea 标签
- HTML select下拉列表标签
- HTML checkbox 多选框
- HTML font color 标签
- HTML iframe 框架标签
- HTML Table 表格
- HTML dl dt dd 标签
- HTML ol li有序列表标签
- HTML ul li 无序列表标签
- HTML 注释
- CSS 教程
- CSS 简介
- CSS 语法
- CSS Id 和 Class选择器
- CSS 样式的创建
- CSS background 背景介绍
- CSS 文本样式
- CSS font 字体
- CSS A 链接
- CSS ul ol列表样式
- CSS TABLE 样式
- CSS 框模型
- CSS border 边框
- CSS Outlines 轮廓
- CSS 外边距 Margin
- CSS Padding 内边距
- CSS 分组和嵌套选择器
- CSS 尺寸 (Dimension)
- CSS Display 属性
- CSS Position 定位
- CSS Float 浮动
- CSS 水平对齐(Horizontal Align)
- CSS 组合选择符
- CSS 伪类
- CSS 伪元素
- CSS 导航栏
- CSS 下拉菜单
- CSS 图片廊
- CSS 图像透明/不透明
- CSS sprite 图像拼合技术
- CSS 媒体类型
- CSS 属性选择器
- CSS 实例
- Linux中无法远程连接数据库问题的解决方法
- VIM实现文件快速跳转插件详解
- 详解linux usb host驱动编写入门
- CentOS服务器平台搭建mysql主从复制与读写分离的方法
- Centos7中添加、删除Swap交换分区的方法
- Bash中文件描述符的详细介绍
- Linux 块设备驱动代码编写
- ubuntu中终端命令提示符太长的修改方法汇总
- CentOS 6.5 环境实现本地局域网搭建YUM的方法【基于FTP】
- iPhone手机越狱-逆向砸壳-代码注入
- Flutter基础widgets教程-SizedBox篇
- 详解linux 看门狗驱动编写
- CentOS 6.5平台本地YUM配置的方法
- Linux环境(CentOS6.7 64位)下安装subversion1.9.5的方法
- CentOS 6.5平台实现快速部署FTP的方法