CSS3:立体导航栏

这里写图片描述

        .box{
            width: 600px;
            height: 50px;
            background: red;
            margin: 100px auto 0; 
            border-radius:10px;
            box-shadow: 0 5px 2px #a80000;
        }
        .box ul{
            height: 100%;
            padding: 0 5%;
            list-style: none;
            color: #fff;
            display: flex;
            justify-content: space-around;
            font:bold 16px/50px Arial;


        }
        .box ul li{
            height: 100%;
            width: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            text-shadow:2px 2px 4px rgba(0,0,0,.5);
            background: linear-gradient(red,#a82724,red) no-repeat right/1px 15px;
        }
        .box ul li:last-of-type{
            background:none;
        }
        .box ul li a{
            text-decoration: none;
            color: #fff;

        }
        .box ul li a:hover{
            transform: rotate(10deg);
        }


    <div class="box">
        <ul>
            <li><a href="#">home</a></li>
            <li><a href="#">home</a></li>
            <li><a href="#">home</a></li>
            <li><a href="#">home</a></li>
            <li><a href="#">home</a></li>
            <li><a href="#">home</a></li>
        </ul>
    </div>

记录点:
background: linear-gradient(red,#a82724,red) no-repeat right/1px 15px;
1.背景图颜色线性变化,生成分割线 position和size连写是一定要斜杠分开
2.多重背景,先写的盖住后写的,background-color只能设定一个。
背景线性变化亮点挺多的,需要多运用

拓展:
两边都需要分割线:
这里写图片描述

        .box ul:before{
            content: "";
            height: 15px;
            width: 1px;
            display: flex;
            align-self: center;
            background: linear-gradient(to left,red,black,red) no-repeat right/1px 15px;

        }
        /*.box ul li:last-of-type{
            background:none;
        }*/
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值