zoukankan      html  css  js  c++  java
  • css实现图片上下模糊(附带效果图)

    css控制图片模糊,毛玻璃效果

    css控制图片上下模糊,鼠标移入模糊清除!

    html代码:

    <ul>
                            <li>
                                <div class="ig">
                                    <a class="img-box" href="">
                                        <img src="images/cust1.jpg" alt="">
                                        <div class="burl">
                                            <img src="images/cust1.jpg" alt="">
                                        </div>
                                        <div class="burl-t">
                                            <img src="images/cust1.jpg" alt="">
                                        </div>
                                    </a>
                                    <div class="text">
                                        <p>Three arm sprinkler with round base</p>
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="ig">
                                    <a class="img-box" href="">
                                        <img src="images/cust1.jpg" alt="">
                                        <div class="burl">
                                            <img src="images/cust1.jpg" alt="">
                                        </div>
                                        <div class="burl-t">
                                            <img src="images/cust1.jpg" alt="">
                                        </div>
                                    </a>
                                    <div class="text">
                                        <p>Three arm sprinkler with round base</p>
                                    </div>
                                </div>
                            </li>
    <ul>
    

      

    css代码:图片宽度设置了100%,加入了hover图片放大过渡效果

    .img-box {
        overflow: hidden;
        position: relative;
    }
    
    .img-box img {
        transition: 1s ease;
    }
    
    .img-box:hover img {
        transform: scale(1.1, 1.1);
    }
    
    ul li .ig .img-box .burl {
      transition: 1s all cubic-bezier(.46, 1, .23, 1.52);
      position: absolute;
                    top: 0;
                     115%;
                    height: 80px;
                    overflow:hidden;
                    transform: translate(-10px,-10px);
                    filter: blur(5px);
    }
    ul li .ig .img-box .burl-t {
      transition: 1s all cubic-bezier(.46, 1, .23, 1.52);
      position: absolute;
                    bottom: 0;
                     115%;
                    height: 80px;
                    overflow:hidden;
                    transform: translate(-10px,10px);
                    filter: blur(5px);
    }
    ul li .ig .img-box:hover .burl {
      height: 0;
    }
    ul li .ig .img-box:hover .burl-t {
      height: 0;
    } 

     

    效果图:

    左侧是鼠标移入触发hover,右侧是原始状态。

    GIF图效果:

     

  • 相关阅读:
    centos7 yum安装配置Lnmp和负载配置
    Linux搭建lamp(Apache+PHP+Mysql环境)centos7.2版详细教程
    php的移位符运算
    Mysql的注入与防御
    介绍10个非常有用的PHP函数
    PHP性能的分析
    Netty 4源码解析:服务端启动
    centOS6.6升级gcc4.8
    kafka 0.8.x producer Example(scala)
    spark standalone zookeeper HA部署方式
  • 原文地址:https://www.cnblogs.com/chalkbox/p/12776150.html
Copyright © 2011-2022 走看看