• Css3案例


    <!DOCTYPE html>
    <html>
    <meta charset=utf-8>
        <head>
            <style> 
                body{
                    backgound:#f9f9f9;
                }
                .img{
                    position: absolute;
                     300px;
                    height: 200px;
                    border:10px solid #ccc;
                    overflow:hidden;
    
                }
                .img img{
                    100%;
                    height:100%;
                    transition:all .3s ease;
                }
                .img:hover img{
                    -webkit-transform:scale(1.5);
                }
                .back{
                    z-index:9999;
                    background-color: rgba(219,127,8, 0);
                    position: absolute;
                    top: 0;
                    left: 0;
                    height:100%;
                    text-align: center;
                    color: #000;
                    -webkit-transition:all .5s  ease;
                    
                }
                .back h2{
                    text-align:center;
                    color:#000;
                    -webkit-transition:all .5s  ease;
                    background-color: rgba(0,0,0, 0.5);
                    height:30px;
                    position: relative;
                    top: -55px;
                }
                .back p{
                    position: relative;
                    bottom: -130px;
                    -webkit-transition:all .5s  ease;
                }
                
                
                .back:hover h2{
                    text-align:center;
                    color:#fff;
                    top:0;
                }
    
                .back:hover p{
                    text-align:center;
                    color:#fff;
                    bottom:0;
                }
    
                
                .info{
                    background-color: rgba(0,0,0,.7);
                    padding:5px;
                    color:#fff;
                    text-decoration: none;
                    -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
                   filter: alpha(opacity=0);
                   opacity: 0;
                   
                   -webkit-transition: all 0.2s ease-in-out;
                   -moz-transition: all 0.2s ease-in-out;
                   -o-transition: all 0.2s ease-in-out;
                   -ms-transition: all 0.2s ease-in-out;
                   transition: all 0.2s ease-in-out;
                }
                .back:hover a{
                    -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
                   filter: alpha(opacity=100);
                   opacity: 1;
                   -webkit-transform: translateY(0px);
                   -moz-transform: translateY(0px);
                   -o-transform: translateY(0px);
                   -ms-transform: translateY(0px);
                   transform: translateY(0px);
                }
                
                .back:hover{
                    background-color: rgba(219,127,8,.7);
                }
    
            </style>
        </head>
    <body>
    
    <div class="img">
    
        <img src="1.jpg">
        <div class="back">
            <h2>Hover Style #1</h2>
            <p>A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.</p>
            <a href="#" class="info">Read More</a>
        </div>
        
    </div>
    
    
    
    
    </body>
    </html>

    <!DOCTYPE html>
    <html>
    <meta charset=utf-8>
        <head>
            <style> 
                body{
                    backgound:#f9f9f9;
                }
                .view {
                     300px;
                    height: 200px;
                    margin: 10px;
                    float: left;
                    border: 10px solid #fff;
                    overflow: hidden;
                    position: relative;
                    text-align: center;
                    -webkit-box-shadow: 2px 1px 5px #ccc;
                    -moz-box-shadow: 2px 1px 5px #ccc;
                    box-shadow: 2px 1px 5px #ccc;
                    cursor: default;
                    background: #fff;
                }
                
                .mask{
                     360px;
                    height: 470px;
                    background: rgba(115,146,184, 0.7);
                    position: absolute;
                    top: 0px;
                    left: 0px;
                    -webkit-transition: all 0.2s ease-in-out;
                    -moz-transition: all 0.2s ease-in-out;
                    -o-transition: all 0.2s ease-in-out;
                    -ms-transition: all 0.2s ease-in-out;
                    transition: all 0.2s ease-in-out;
                    transform: translate(265px, 145px) rotate(45deg);
    
                }
                
                .view:hover .mask{
                    
                    left: -249px;
                    top: -313px;
                    
                }
                .content{
                    position:absolute;
                    top:0;
                    left:0;
                    100%;
                    height:100%;
                    z-index:9999;
                }
                .content h2{
                    position: absolute;
                    top: -80px;
                     100%;
                    right: -310px;
                    color:#fff;
                    transition: all 0.2s ease-in-out;
                }
                
                .content:hover h2{
                    top:0;
                    left:0;
                }
                .content p{
                    position: absolute;
                     100%;
                    bottom: -100px;
                    color:#fff;
                    right: -319px;
                    transition: all 0.5s ease-in-out;
                }
    
    
                .content:hover p{
                    bottom:0;
                    left:0;
                }
                .info{
                    text-decoration: none;
                    color:#fff;
                    background: rgba(11, 11, 11, 0.8);
                    padding:10px;
                    position: relative;
                    top: -40px;
                    transition: all 0.9s ease-in-out;
                }
                
                .vide:hover a{
                    top:60px;
                
                }
                
            </style>
        </head>
    <body>
    
    <div class="view view-second">
        <img src="1.jpg">
        
        <div class="mask"></div>
        
        <div class="content vide">
            <h2>Hover Style #2</h2>
            <p>A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.</p>
            <a href="#" class="info">Read More</a>
        </div>
        
    </div>
    
    
    
    
    </body>
    </html>

    人如代码,规矩灵活;代码如诗,字句精伦。
  • 相关阅读:
    gateway调用Fegin失败问题解决
    JVM调试命令简介
    oracle10g登录em后,提示“java.lang.Exception: Exception in sending Request :: null”
    vs2019中让ashx 文件中折叠收起代码
    oracle多表视图不自动更新,手动刷新视图获得基本表的数据
    可以对表单中的隐藏字段进行操纵 问题参数 __VIEWSTATEGENERATOR
    SQL Server 检测到基于一致性的逻辑 I/O 错误 页撕裂
    WIN2016和WIN10关闭同步主机服务,节省磁盘频繁读取,并关闭自动维护
    IIS网站应用程序配置不继承网站.net框架版本
    c#web错误码CS0227,不安全代码只会在使用/unsafe编译情况下出现
  • 原文地址:https://www.cnblogs.com/xinlinux/p/4118196.html
Copyright © 2020-2023  润新知