图片放上效果ImageHover.css

网页效果中经常会用到图片的hover效果,ImageHover.css 这个库为我们提供了多种的效果。

兼容性

插件是使用css3书写的,所以最好是对css3支持比较好的浏览器。如果需要考虑到兼容性问题,那么建议使用我自己写的jq版效果,虽然效果单一,但是兼容性更好。

效果演示地址

image

下载

  • 直接下载

链接:http://imagehover.io/

  • github 地址

github 地址:https://github.com/ciar4n/imagehover.css

  • Bower 安装
bower install imagehover.css

使用

  • 1、在页面的head 部位引入插件
<head>
  <link rel="stylesheet" href="css/imagehover.min.css">
</head>
  • 2、HTML代码

其中figure标签的class imghvr-fade就是对应的CSS hover 效果,这个 Class 名称

<figure class="imghvr-fade">
  <img src="#">
  <figcaption>
    // Hover Content
  </figcaption>
</figure>
  • 3、如果图片上需要添加链接,这时html 代码如下
<figure class="imghvr-fade">
    <img src="#">
    <figcaption>
      // Hover Content
    </figcaption>
    <a href="http://www.imagehover.io"></a>
</figure>
  • 4、统一修改hover效果的背景颜色

修改 imagehover.css 文件

[class^='imghvr-'],
[class*=' imghvr-'] {
  background-color: #D14233;
}
  • 5、单独修改某个hover效果代码
<figure class="imghvr-fade" style="background-color:#D14233;">
    <img src="#">
    <figcaption>
      // Hover Content
    </figcaption>
</figure>

部分演示代码

<div class="demo">
  <figure class="imghvr-zoom-out-down"><img src="example-image.jpg" alt="example-image">
    <figcaption>
      <h3>Weber</h3>
      <p>Web开发者,努力学习中</p>
    </figcaption><a href="javascript:;"></a>
  </figure>
  <textarea onclick="this.focus();this.select()" readonly="readonly">imghvr-zoom-out-down</textarea>
</div>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值