HTML——左菜单栏三角(鼠标放置显示菜单栏)

 css:

        .left-box {
            top: 50px;
            width: 150px;
            height: 100%;
            /* 设置固定定位(让其脱离正常文档流) */
            position: fixed;
        }

        .left-box li {
            list-style: none;
        }

        .left-box ul>li ol {
            width: 200px;
            /* ol标签作为子元素 绝对定位 */
            position: absolute;
            /*垂直位置 */
            top: -1px;
            right: -230px;
            /* 隐藏元素 */
            display: none;
            border: 2px solid #ccc;
            /* 内边距 */
            padding: 30px;
            /* 背景颜色 */
            background-color: white;
            /* 设置圆角属性 */
            border-radius: 10px;

        }

        /* 伪类元素 */
        .left-box ul>li ol::before {
            content: "";
            display: block;
            width: 0;
            height: 0;
            border: 20px solid transparent;
            border-right-color: #ccc;
            position: absolute;
            left: -38px;
            top: 2px;
        }

        .left-box ul>li ol::after {
            content: "";
            display: block;
            width: 0;
            height: 0;
            border: 20px solid transparent;
            border-right-color: white;
            position: absolute;
            left: -37px;
            top: 2px;
        }


        .left-box ul>li:hover ol {
            display: block;
            height: 200px;
        }

html:

 <div class="left-box">
        <ul>
            <li>
                <div class="content">
                    <i class="icon icon-2"></i>
                    <span>11</span>
                </div>
                <ol>
                </ol>
            </li>
        </ul>

   </div>

图例:

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值