header.css 7.2 KB
/* header */
.header {
    min-width: 1200px;
    z-index: 20;
    position: fixed;
    top: 0;
    height: 90px;
    width: 100%;
    background: rgba(1, 1, 15, 1);
    -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
}

.head-container {
    padding: 0 30px;
    width: auto;
    height: 100%;
}

.header .logo {
    width: 132px;
    height: 40px;
    display: inline-block;
    margin-top: 25px;
    float: left;
}

.header .logo img {
    width: 100%;
}

.header-lf {
    display: inline-block;
    float: left;
}

.navbar {
    float: left;
    margin-left: 26px;
}

.navbar * {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.category-item {
    float: left;
    position: relative;
}

.category-a {
    display: block;
    font-size: 14px;
    line-height: 90px;
    color: #b1bae3;
    padding: 0 10px;
    -webkit-transition: all .8s;
    -o-transition: all .8s;
    transition: all .8s;
    position: relative;
    margin: 0 14px;
}

.category-a::after {
    content: '';
    width: 0;
    height: 2px;
    background: #fff;
    position: absolute;
    bottom: 0;
    left: 50%;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    -webkit-transition: all .8s;
    -o-transition: all .8s;
    transition: all .8s;
}

.category-item.active .category-a::after, .category-item:hover .category-a::after, .category-item.on .category-a::after {
    width: 100%;
}

.category-item.active .category-a, .category-item:hover .category-a, .category-item.on .category-a {
    color: #fff;
}


.header-right {
    float: right;
}

.head-tel {
    margin-top: 30px;
    float: left;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding-left: 15px;
    margin-left: 7px;
}

.head-tel span {
    display: block;
    float: left;
    font-size: 18px;
    text-align: center;
    color: #b1bae3;
    line-height: 30px;
    font-family: 'Hel';
    padding-left: 35px;
    background: url(../images/tel.png) no-repeat left center;
}

.header .butt-search {
    border: none;
    background: none;
    float: left;
    width: 30px;
    line-height: 30px;
    margin-top: 30px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    -webkit-transition: .5s;
    -moz-transition: .5s;
    -ms-transition: .5s;
    -o-transition: .5s;
    transition: .5s;
    z-index: 10;
}

.header .sub-bot {
    display: block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    background: transparent;
    border: none;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 3;
    cursor: pointer;
    background: url(../images/icon-search.png) no-repeat center transparent;
}

.header .sub-txt {
    display: block;
    margin-left: 26px;
    line-height: 30px;
    color: #909090;
    font-weight: lighter;
    background: transparent;
    border: none;
    padding: 0 30px 0 0px;
    box-sizing: border-box;
    width: 130px;
    font-size: 0;
}

.header .butt-search:hover {
    background: #e2e2e2;
    border-radius: 20px;
    width: 180px;
}

.header .butt-search:hover .sub-txt {
    font-size: 14px;
}


.dropdown-menu ul {
    padding: 0 30px 30px 30px;
}

.dropdown-menu.single {
    position: absolute;
    top: 100%;
    left: 50%;
    -webkit-transform: translate(-50%, 0);
    -ms-transform: translate(-50%, 0);
    transform: translate(-50%, 0);
    /* width: auto; */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    background: rgba(0, 43, 104, .7);
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    -webkit-transition: max-height .5s;
    -o-transition: max-height .5s;
    transition: max-height .5s;
    border: none;
    color: #303233;
    height: auto;
    padding: 0;
    display: block;
}

.dropdown-menu.single li {
    display: block;
    font-size: 16px;
    width: 100%;
    -webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
    border-bottom: 1px dashed #959595;
    position: relative;
}

.dropdown-menu.single li > a {
    padding: 21px 30px;
    white-space: nowrap;
    display: block;
    text-align: center;
    width: 100%;
    color: #d5dbf7;
    line-height: 1;
    height: auto;
    background: 0 0;
    -webkit-transition: all .3s;
    -o-transition: all .3s;
    transition: all .3s;
}

.dropdown-menu.single li > i {
    display: block;
    font-size: 16px;
    color: #4d4d4d;
    position: absolute;
    right: 25px;
    top: 50%;
    margin-top: -8px;
}

.dropdown-menu.single li:hover a {
    color: #fff;
}

.dropdown-menu.single li:hover i {
    color: #0e48a7;
}

.category-item:hover .dropdown-menu.single {
    max-height: 450px;
    opacity: 1;
}

.mobile-header-navbar {
    display: none;
}

/*移动端适配*/
@media (max-width: 768px) {
    .header {
        min-width: 0;
        width: 100vw;
        height: 70px;
    }

    .head-container {
        padding: 0 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header .logo {
        margin-top: 0;
    }

    .header-lf .navbar {
        display: none;
    }

    /*移动端菜单*/
    .mobile-header-navbar {
        display: block;
        float: right;
        position: relative;
    }

    .mobile-navbar {
        display: none;
        position: absolute;
        top: 50px;
        right: 0;
        width: 70vw;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
        background: rgba(0, 43, 104, .8);
        color: #ffffff;
        z-index: 100;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .show-mobile-navbar .mobile-navbar {
        display: block;
        position: absolute;
    }

    .mobile-category-a {
        color: #ffffff;
        display: block;
        font-size: 14px;
        line-height: 30px;
        padding: 10px;
        -webkit-transition: all .8s;
        -o-transition: all .8s;
        transition: all .8s;
        position: relative;
        border-bottom: 1px solid rgba(255, 255, 255, .6);
        position: relative;
    }

    .mobile-category-a:focus, .mobile-category-a:hover {
        text-decoration: none !important;
        color: #ffffff !important;
    }

    .mobile-category-icon {
        width: 16px;
        height: 16px;
        border: none;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: url("../images/right.png") no-repeat center;
        background-size: cover;
    }

    .show-dropdown-menu .mobile-category-icon {
        background: url("../images/bottom.png") no-repeat center !important;
        background-size: cover;
    }

    .mobile-dropdown-menu {
        display: none;
        height: 0;
        position: relative;
        -webkit-transition: all .2s;
        -o-transition: all .2s;
        transition: all .2s;
        border-bottom: 1px solid rgba(255, 255, 255, .6);
    }

    .mobile-dropdown-menu ul li a {
        padding: 6px 6px 6px 20px;
        color: #ffffff;
        display: block;
        font-size: 14px;
        line-height: 30px;
        position: relative;
        background: rgba(0, 43, 104, .5);
    }

    .show-dropdown-menu .mobile-dropdown-menu {
        display: block;
        height: auto;
    }

    .header-right {
        opacity: 0;
    }
}