纯css实现tab选项卡切换动画

代码语言:html

所属分类:选项卡

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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title>nezt</title>

    <style>
        * {
            font-family: 'Work Sans', sans-serif;
        }

        html, body {
            height: 100%;
            color: #1a1b1c;
        }

        label, a {
            cursor: pointer;
            user-select: none;
            text-decoration: none;
            display: inline-block;
            color: inherit;
            transition: border 0.2s;
            border-bottom: 5px solid rgba(142, 68, 173, 0.2);
            padding: 3px 2px;
        }
        label:hover, a:hover {
            border-bottom-color: #9b59b6;
        }

        .layout {
            display: grid;
            height: 100%;
            width: 100%;
            overflow: hidden;
            grid-template-rows: 50px 1fr;
            grid-template-columns: 1fr 1fr 1fr;
        }

        input[type="radio"] {
            display: none;
        }

        label.nav {
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border-bottom: 2px solid #8e44ad;
            background: #ecf0f1;
            user-select: none;
            transition: background 0.4s, padding-left 0.2s;
            padding-left: 0;
        }
        input[type="radio"]:checked + .page + label.nav {
            background: #9b59b6;
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0