纯css实现一个简洁的树形菜单效果代码

代码语言:html

所属分类:菜单导航

代码描述:纯css实现一个简洁的树形菜单效果代码

代码标签: 一个 简洁 树形 菜单 效果

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

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="UTF-8">


    <style>
        body {
            background: white;
       
        }
        .tree-menu {
            line-height: 1em;
        }

        .tree-menu,
        .tree-menu ul {
            margin: 0;
            padding: 0;
            list-style-type: none;
        }

        .tree-menu > li {
            margin-bottom: 0.5em;
        }

        .tree-menu ul {
            position: relative;
            margin-top: 0.5em;
            margin-left: 1em;
        }
        .tree-menu ul:before {
            content: "";
            display: block;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 0;
            border-left: 1px solid currentColor;
        }

        .tree-menu ul li {
            position: relative;
            margin: 0;
            padding: 0.5em 1em;
        }

        .tree-menu ul li:before {
            content: "";
            display: block;
            position: absolute;
            top: 1em;
            left: 0;
            width: 0.5em;
            height: 0;
            border-top: 1px solid currentColor;
        }

        .tree-menu ul li:last-child:before {
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0