zoukankan      html  css  js  c++  java
  • HTML+CSS鼠标悬停效果

    HTML+CSS实现鼠标悬停效果

    HTML:

    <link href="style.css" rel="stylesheet">
    
    <a class="social" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-facebook"></i>
         </div>
         <div class="back">
            <i class="fa fa-facebook"></i>
         </div>
    </a>
    
    <a class="social social-twitter" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-twitter"></i>
         </div>
         <div class="back">
            <i class="fa fa-twitter"></i>
         </div>
    </a>
    
    <a class="social social-github" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-github"></i>
         </div>
         <div class="back">
            <i class="fa fa-github"></i>
         </div>
    </a>
    
    <a class="social social-pinterest" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-pinterest"></i>
         </div>
         <div class="back">
            <i class="fa fa-pinterest"></i>
         </div>
    </a>
    
    <a class="social social-googleplus" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-google-plus"></i>
         </div>
         <div class="back">
            <i class="fa fa-google-plus"></i>
         </div>
    </a>
    
    <a class="social social-skype" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-skype"></i>
         </div>
         <div class="back">
            <i class="fa fa-skype"></i>
         </div>
    </a>
    
    <a class="social social-linkedin" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-linkedin"></i>
         </div>
         <div class="back">
            <i class="fa fa-linkedin"></i>
         </div>
    </a>
    
    <a class="social social-skype" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-skype"></i>
         </div>
         <div class="back">
            <i class="fa fa-skype"></i>
         </div>
    </a>
    
    <a class="social social-dribbble" href="https://webbb.be" target="_blank">
         <div class="front">
            <i class="fa fa-dribbble"></i>
         </div>
         <div class="back">
            <i class="fa fa-dribbble"></i>
         </div>
    </a>

    CSS:

    /**
     * CSS3 social icon hover effect
     * Read more on my blog: http://webbb.be/blog/
     */
    
    body {
        background: #f06;
        background: linear-gradient(45deg, #f06, yellow);
        min-height: 100%;
    }
    a,a:visited { color: #fff; }
    a:hover { color: #fff; }
    
    .social {
        float: left;
        margin: 2em 2em; width: 100px; height: 100px;     
        display: block; text-align: center; line-height:103px; color: #fff;
        
        position: relative;
        transform:rotateY(0deg);
        transition:transform .25s ease-out;
        transform-style:preserve-3d;
    }
    .social > div {
        width: 100px; height: 100px; background: #000;
        position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    }
    .social >.front {
        transform:translateZ(40px);
    }
    .social >.back {
        background: #3B5998; font-size: 3em;
        transform:rotateY(-100deg) translateZ(40px);
    }
    
    /*  Social Media Colors 
        Facebook #3B5998
        Flickr #FE0883
        Foursquare #8FD400
        Google+ #C63D2D
        Instagram #4E433C
        Linkedin #4875B4
        Tumblr #2B4964
        Twitter #33CCFF
        Vimeo #86B32D
        Youtube #FF3333
        Dribbble #ea4c89
    */
    .social.social-twitter > .back { background: #55ACEE; }
    .social.social-github > .back { background: #f3f3f3; color: #000; }
    .social.social-pinterest > .back { background: #e3262e; }
    .social.social-googleplus > .back { background: #dd4B39; }
    .social.social-skype > .back { background: #12A5F4; }
    .social.social-linkedin > .back { background: #4875B4; }
    .social.social-dribbble > .back { background: #ea4c89; }
    
    /* Hover */
    .social:hover {
        transform: rotateY(100deg);
    }

    效果:

  • 相关阅读:
    Python实例---抽屉后台框架分析
    Python学习---Django的验证码
    Python学习---DjangoForm的总结大全
    思维导图---思维导图网站
    编码学习---代码OJ网站
    multiple definition of XXX情况分析
    Qt 之 pro 配置详解
    萨尔曼可汗 数学视频
    Android sendevent/getevent 用法
    inux 驱动程序开发中输入子系统总共能产生哪些事件类型(EV_KEY,EV_ABS,EV_REL)
  • 原文地址:https://www.cnblogs.com/520future/p/7465286.html
Copyright © 2011-2022 走看看