css悬停按钮交叉动画效果代码

代码语言:html

所属分类:悬停

代码描述:css悬停按钮交叉动画效果代码

代码标签: 交叉 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<html>
<head>
    <style>
@import 'https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300';

        html,
        body {
            width: 100%;
            height: 100%;
            overflow: hidden;
            margin: 0;
            display: flex;
            flex-direction: column;
            flex-wrap: wrap;
            font-family: 'Open Sans Condensed', sans-serif;
        }

        div[class*=box] {
            height: 33.33%;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .box-1 {
            background-color: #FF6766;
        }
        .box-2 {
            background-color: #3C3C3C;
        }
        .box-3 {
            background-color: #66A182;
        }

        .btn {
            line-height: 50px;
            height: 50px;
            text-align: center;
            width: 250px;
            cursor: pointer;
        }

        /*
========================
      BUTTON ONE
========================
*/
        .btn-one {
            color: #FFF;
            transition: all 0.3s;
            position: relative;
        }
        .btn-one span {
            transition: all 0.3s;
        }
        .btn-one::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            opacity: 0;
            transition: all 0.3s;
            border-top-width: 1px;
            border-bottom-width: 1px;
            border-top-style: solid;
            border-bottom-style: solid;
            border-top-color: rgba(255,255,255,0.5);
            border-bottom-color: rgba(255,255,255,0.5);
            transform: scale(0.1, 1);
        }
        .btn-one:hover span {
            letter-spacing: 2px;
        }
        .btn-one:hover::before {
            opacity: 1;
            transform: scale(1, 1);
        }
        .btn-one::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            transition: all 0.3s;
            background-color: rgba(255,255,255,0.1);
        }
        .btn-one:hover::after {
            opacity: 0;
            transform: scale(0.1, 1);
        }


        /*
========================
      BUTTON TWO
========================
*/
        .btn-two {
            color: #FFF;
            transition: all 0.5s;
            position: relative;
        }
        .btn-two span {
            z-index: 2;
            display: block;
            position: absolute;
            width: 100%;
            heig.........完整代码请登录后点击上方下载按钮下载查看

网友评论0