前端学习——仿原神官网顶部导航栏

前端学习——仿原神官网顶部导航栏

通过使用CSS html实现原神官网的导航栏

本人做的

在这里插入图片描述

原神官网

在这里插入图片描述

后续将把顶部标签hover效果的教程发出

下面来看看代码

 <!-- 顶部固定导航栏 -->
        <div class="header-wrap">
            <div class="header-container-bar">
                <div class="music">
                    <img src="./images/index.png" alt="">
                </div>
                <div class="header-wrap-nav">
                    <div class="topbar-wrap">
                        <a class="header__navitem" href="">&nbsp;</a>
                        <a class="header__navitem" href="">&nbsp;</a>
                        <a class="header__navitem" href="">&nbsp;</a>
                        <a class="header__navitem" href="">&nbsp;</a>
                        <a class="header__navitem" href="">&nbsp;</a>
                        <a class="header__navitem" href="">&nbsp;</a>
                    </div>
                </div>
                <div class="header-wrap-right">
                    <a href="" class="wrap-right">
                        <span>成长关爱系统</span>
                        <img src="./images/index2.png" alt="">
                    </a>
                    <a href="" class="wrap-right">
                        <span>登录</span>
                        <img src="./images/index3.png" alt="">
                    </a>
                </div>
            </div>
        </div>

CSS

.header-wrap{
    position: fixed;
    z-index: 9999;
    width: 1920px;
    height: 66px;
    background-color: rgba(0,0,0,.65);
    box-shadow: 0px 1px 1px 0px rgb(0 0 0 / 0.75);
}
/* 容器大小 */
.music{
    float: left;
    width: 317px;
    height: 66px;
    background-image: url(../images/f78aabc.png);
    background-size: cover;
    margin-left: 8px;
    position: relative;
}
.music>img{
    width: 30px;
    height: 30px;
    float: left;
    position: absolute;
    left: 20%;
    top: 16.5px;
}
.header-wrap-nav{
    position: relative;
    width: 600.2px;
    height: 66px;
    float: left;
    margin-left: -46px;
    padding-right: 10px;
}
.topbar-wrap{
    height: 66px;
    line-height: 66px;
    font-size: 17px;
}
.topbar-wrap>a{
    float: left;
    width: 40.0333333px;
    margin: 0 30px;
    color: rgba(255,255,255,0.7);
}
.header-wrap-right{
    height: 66px;
    line-height: 66px;
    font-size: 17px;
    float:right;
}
.header-wrap-right>a{
    float: left;
    width: auto;
    height: 66px;
    margin-right: 30px;
    color: rgba(255,255,255,0.7);
}
.header-wrap-right>a>img{
    width: 27px;
    height: 27px;
    margin-left: 18px;
    opacity: .7;
}
  • 7
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

玄东林檎

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值