<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>瀑布流</title>
<link rel="stylesheet" href="css/style.css">
<script src="js/jquery-3.4.1.js" type="text/javascript"></script>
</head> <body> <section id="titleBar">
<h2>瀑布流</h2>
</section>
<div id="wrap">
<!-- wrap内快速生成里面div结构的快捷方式 -->
<!-- (div.box>div.info>((div.pic>img[src="img/$.jpg"])+(div.title>a[href=#]{This is a title})))*10 -->

<div class="box">
<div class="info">
<div class="pic"><img src="img/1.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/2.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/3.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/4.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/5.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/6.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/7.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/8.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/9.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
<div class="box">
<div class="info">
<div class="pic"><img src="img/10.jpg" alt=""></div>
<div class="title"><a href="#">This is a title.</a></div>
</div>
</div>
</div> </body> </html>

css文件如下

body {
margin:;
padding:;
} body {
background: #ddd url(../img/bg.jpg) repeat;
} img {
border: none;
} a {
text-decoration: none;
color: #444;
} @-webkit-keyframes shade {
from {
opacity:;
}
15% {
opacity: 0.4;
}
to {
opacity:;
}
} @-moz-keyframes shade {
from {
opacity:;
}
15% {
opacity: 0.4;
}
to {
opacity:;
}
} @-o-keyframes shade {
from {
opacity:;
}
15% {
opacity: 0.4;
}
to {
opacity:;
}
} @-ms-keyframes shade {
from {
opacity:;
}
15% {
opacity: 0.4;
}
to {
opacity:;
}
} @keyframes shade {
from {
opacity:;
}
15% {
opacity: 0.4;
}
to {
opacity:;
}
} #titleBar {
width: 600px;
margin: 20px auto;
text-align: center;
} #wrap {
width: auto;
height: auto;
margin: 0 auto;
position: relative;
} #wrap .box {
width: 280px;
height: auto;
padding: 10px;
border: none;
float: left;
} #wrap .box .info {
width: 280px;
height: auto;
border-radius: 8px;
background: #fff;
} #wrap .box .info .pic {
width: 260px;
height: auto;
margin: 0 auto;
padding-top: 10px;
} #wrap .box .info .pic:hover {
-webkit-animation: shade 3s ease-in-out 1;
-moz-animation: shade 3s ease-in-out 1;
-o-animation: shade 3s ease-in-out 1;
-ms-animation: shade 3s ease-in-out 1;
animation: shade 3s ease-in-out 1;
} #wrap .box .info .title:hover {
-webkit-animation: shade 3s ease-in-out 1;
-moz-animation: shade 3s ease-in-out 1;
-o-animation: shade 3s ease-in-out 1;
-ms-animation: shade 3s ease-in-out 1;
animation: shade 3s ease-in-out 1;
} #wrap .box .info img {
width: 260px;
border-radius: 3px;
} #wrap .box .info .title {
width: 260px;
height: 40px;
margin: 0 auto;
line-height: 40px;
text-align: center;
color: #666;
font-size: 18px;
font-weight: bold;
overflow: hidden;
}

效果图如下

望各位大虾不吝赐教!

谢谢

HTML+CSS实现鼠标点上去动画效果的更多相关文章

  1. 一款很实用的jQuery鼠标悬浮有动画效果的响应式瀑布流插件

    一款很实用的jQuery鼠标悬浮有动画效果的响应式瀑布流插件 在线预览 下载地址 实例代码 <!doctype html> <html lang="zh"> ...

  2. 鼠标悬停css3动画效果

    下载Demo 效果预览 html: <!DOCTYPE html> <html lang="en"> <head> <meta chars ...

  3. 简单css实现input提示交互动画效果

    通过基础CSS实现输入提示交互动画效果,并兼容各浏览器! 1.效果展示 2.css代码 h4 { margin: 30px 0; } input { margin:; font-size: 16px; ...

  4. 基于jQuery CSS3鼠标点击动画效果

    分享基于jQuery CSS3鼠标点击动画效果支持图片或内容滑动,允许设置动画延迟效果.效果图如下: 在线预览   源码下载 实现的代码. html代码: <div class="co ...

  5. animate.css 一些常用的CSS3动画效果

    大家已经开始在项目中使用一些CSS3动画效果了吧,这让网站在高端浏览器上看起来很上流.animate.css是一个老外做的各种CSS3动画的合集,比较全,也很炫,大家可以参考学习一下. 项目主页:ht ...

  6. CSS控制鼠标滑过时的效果

    用css控制鼠标样式的语法如下:<span style="cursor:*">文本或其它页面元素</span>把 * 换成如下15个效果的一种: 下面是对这 ...

  7. 一个CSS+jQuery的放大缩小动画效果

    日期: 2013年9月23日 作者:铁锚 // 今天帮朋友写了一些代码,自己觉得写着写着,好几个版本以后,有点满意,于是就贴出来. // 都是定死了的.因为需求就只有4个元素.如果是要用CSS的cla ...

  8. 用CSS实现加载的动画效果

    用纯CSS实现加载的一些动态效果,可以把加载效果中的元素分成很多个小部分,每个部分都有动画,每个部分的动画再设置相应的延迟效果,这样,看起来就是连贯的加载动画效果.代码如下: 1.效果1 <di ...

  9. 前端每日实战:140# 视频演示如何用纯 CSS 创作文本的淡入动画效果

    效果预览 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/ZMwgqK 可交互视频 此视频是可 ...

随机推荐

  1. 离线环境下自动化部署python环境(含openssl)

    遇到有项目要在内网环境下安装python项目,所以空余时写了自动化部署python环境和python项目的脚本,由于项目涉密,这里仅提供自动化部署python环境的shell脚本,包括openssl的 ...

  2. zabbix--监控MySQL性能

    Zabbix 自带模板监控 MySQL 性能 通过自带的 Template DB MySQL 模板监控 MySQL 性能 具体步骤: 1)创建脚本存放目录并编辑脚本 # mkdir /etc/zabb ...

  3. Spark SQL中的Catalyst 的工作机制

      Spark SQL中的Catalyst 的工作机制 答:不管是SQL.Hive SQL还是DataFrame.Dataset触发Action Job的时候,都会经过解析变成unresolved的逻 ...

  4. Zigzag Iterator II

    Description Follow up Zigzag Iterator: What if you are given k 1d vectors? How well can your code be ...

  5. Arduino OV7670 live image over USB to PC

    https://www.youtube.com/watch?v=L9DTW1ulsT0 https://www.youtube.com/watch?v=Dp3RMb0e1eA

  6. Longest Common Substring SPOJ - LCS (后缀自动机)

    Longest Common Substring \[ Time Limit: 294ms \quad Memory Limit: 1572864 kB \] 题意 给出两个串,求两个串的最长公共连续 ...

  7. haproxy2.0 dataplaneapi 简单说明

    haproxy2.0 支持基于dataplaneapi 的haproxy 动态配置修改以及服务生效,早期大家为了动态 可以会基于dsn 的服务发现模式,基于confd 结合consul 动态生成配置并 ...

  8. Vuejs发送Ajax请求

    一.概况 ①vuejs中没有内置任何ajax请求方法 ②在vue1.0版本,使用的插件 vue resource 来发送请求,支持promise ③在vue2.0版本,使用社区的一个第三方库 axio ...

  9. %lld 和 %I64d

    在Linux下输出long long 类型的是 printf("%lld", a); 在Windows下输出是 printf("%I64d", a); xxy学 ...

  10. codevs 2803 爱丽丝·玛格特罗依德

    二次联通门 : codevs 2803 爱丽丝·玛格特罗依德 /* codevs 2803 爱丽丝·玛格特罗伊德 高精 + 找规律 显然, 能拆3就多拆3 不能拆就拆2 注意特判一下 */ #incl ...