简书导航栏实现

效果图

简书官网效果图图

实现效果图

未实现的功能

1.响应式布局未完成
2.个人二级菜单图标未完成
3.导航中消息数量提示未完成

实现步骤

1.css

*{
    padding: 0px;
    margin: 0px;
}
ul,li{
   list-style: none
}
a{
    text-decoration: none;
}
.flex-v-h-center{
    display: flex;
    justify-content: center;
    align-items: center;
}
.height100{
    height: 100%;
}
#header{
    position: fixed;
    top: 0px;
    right: 0;
    left: 0;
    z-index: 9999;
    background-color: #fff;
    border-color: #f0f0f0;
    border-bottom: 1px #ebebeb solid;
}
.header-inner{
    min-width: 768px;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}
nav .logo{
    height: 58px;
}
.flex-layout{
    display: flex;
}
nav .write-btn{
    width: 100px;
    height: 40px;
    line-height: 24px;
    margin: 8px 12px 0;
    border-radius: 20px;
    font-size: 15px;
    color: #fff;
    background-color: #ea6f5a;
    text-align: center;
}

.header-inner .container{
    flex: 1;
    margin-left: 106px;
    display: flex;
}

.dropdown-menu{
    display: none;
}
.dropdown img{
    width: 40px;
    height: 40px;
    border-radius: 100px;
    border: 1px #e0e0e0 solid;
}
.dropdown{
    display: flex;
    position: relative;
}
.right-box .user{
    position: relative;
}
.dropdown a::after{
    content: "";
    position: absolute;
    top: 18px;
    right: -14px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #999;
}
.right-item{
    margin-right: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dropdown-menu li{
    line-height: 31px;
    padding: 0px 15px;
    padding: 10px 28px 4px 20px;
}
.dropdown-menu li a{
    color: #000000;
}
.dropdown-menu li:hover{
    background: #fafafa
}
.right-box .user:hover .dropdown-menu {
    display: block;
    position: absolute;
    background: #ffffff;
    top: 50px;
    white-space: nowrap;
    box-shadow: 0px 3px 3px #d9d9d9;
    padding: 10px 0px;
    border-radius: 2px;

}

.jianshu a img{
    height: 25px;
}
.mode label{
    font-weight: 500;
    color: #818184;
    font-size: 21px;
}

.nav-ul li{
    height: 100%;
    padding: 0px 11px;
}
.nav-ul li:hover{
    background: #fafafa;
}
.nav-ul .nav-item span{
    color: #000;
    margin: 0 6px;

}
.secrch form{
    display: flex;
    position: relative;
}
.secrch{
    align-self: center;
    margin: 0 17px;
}
.secrch input{
    padding: 0 40px 0 20px;
    width: 160px;
    height: 38px;
    font-size: 14px;
    border: 1px solid #eee;
    border-radius: 40px;
    background: #eee;
    outline: none;
    transition: width 0.4s;
}
.secrch input:focus{
    width: 270px
}
.search-img{
    position: absolute;
    align-self: center;
    right: 7px;
}

2.html





    
    
    
    简书
    



    


你可能感兴趣的:(简书导航栏实现)