<header class="header">
<div class="fw">
<a class="logo" href="index.html"><img src="images/logo.png?" alt=""><span>Coin-Fast</span></a>
<div class="navbox">
<div class="nav">
<a class="item active" href="index.html">HOME</a>
<a class="item " href="about.html">COMPANY PROFILE</a>
<a class="item " href="product.html">PRODUCT</a>
<a class="item " href="contact.html">CONTACT US</a>
</div>
</div>
<div class="navbtn">
<div class="line line1"></div>
<div class="line line2"></div>
<div class="line line3"></div>
</div>
</div>
</header>
css navbar 样式
@media screen and (max-width: 1240px) {
.nav .item {
margin: 0 18px;
font-size: 14px;
}
.language .item {
font-size: 14px;
}
.subbanner .fw {
padding-left: 20px;
}
.product-list li .icon {
width: 120px;
}
.product-list li .cons {
margin-left: 30px;
}
.product-list li .name {
font-size: 24px;
padding-bottom: 15px;
}
.product-list li .name::after {
height: 6px;
width: 130px;
}
.product-list li .state {
margin: 20px 0;
}
.product .left {
width: 280px;
}
.product .rightcon {
margin-left: 50px;
}
.product-detail .con {
margin-left: 50px;
}
.product-detail .title {
font-size: 32px;
padding-bottom: 20px;
}
.product-detail .tt {
font-size: 16px;
}
.product-detail .brief {
margin-top: 30px;
}
.contact-us .right .tt3 {
font-size: 24px;
}
.contact-us .right .tt2 {
font-size: 18px;
}
.contact-us .right {
padding: 40px;
}
.contact-us .left .tt1 {
margin-bottom: 50px;
font-size: 36px;
}
.contact-us .left {
padding: 65px 30px 100px 40px;
}
.probox .brief {
font-size: 16px;
margin: 40px 0;
}
.probox .name {
font-size: 36px;
}
.probox .icon {
width: 40%;
}
.probox1 .icon {
text-align: left;
}
.probox2 .icon {
text-align: right;
}
.probox .name::before {
width: 170px;
height: 15px;
}
.abox1 .wrap .brief {
font-size: 16px;
padding-left: 30px;
}
.abox1 .title {
font-size: 32px;
margin-bottom: 30px;
}
.abox1 .wrap .pic {
padding-top: 8px;
}
.abox1 .wrap {
margin-bottom: 60px;
}
.abox1 .list li .ww {
padding: 20px;
}
.common-title p {
font-size: 36px;
}
.abox2 .state {
font-size: 16px;
line-height: 1.7;
margin: 30px 0;
}
.morelist li .ww {
width: 100%;
}
.morelist li {
width: 33.3%;
padding: 0 20px;
}
.morelist {
margin: 80px -20px 0;
}
.video-list li {
padding: 0 12px;
margin-bottom: 24px;
}
.video-list {
margin: 0 -12px;
}
}
@media screen and (max-width: 1080px) {
.nav .item {
margin: 0 14px;
}
.brandlist {
margin: 0 -20px;
}
.brandlist li {
margin-bottom: 30px;
padding: 0 20px;
}
.subbanner .title {
font-size: 32px;
margin-bottom: 15px;
}
.subbanner .state {
font-size: 16px;
}
.subbanner {
padding: 80px 0;
}
.product .fw {
display: block;
}
.product .left {
width: 100%;
margin-bottom: 20px;
}
.product .rightcon {
margin-left: 0;
}
.product .left .brief {
padding-bottom: 15px;
margin-bottom: 20px;
margin-top: 20px;
}
.sort {
display: flex;
flex-wrap: wrap;
}
.sort a {
margin-bottom: 10px;
margin-right: 15px;
}
.morelist li .tt {
font-size: 16px;
margin-bottom: 50px;
}
.video-list li .tt {
font-size: 16px;
}
.video-list li .state {
font-size: 14px;
}
}
@media screen and (max-width: 968px) {
.navbox {
position: fixed;
width: 240px;
background-color: #fff;
top: 0;
box-shadow: -5px 0px 5px 0px rgba(0, 0, 0, .1);
bottom: 0;
display: block;
padding-top: 60px;
right: -300px;
transition: all .8s ease;
background-image: url(../images/bg_main.png);
background-repeat: repeat;
height: 100%;
}
.navbtn {
display: block;
}
.language .item {
justify-content: center;
font-weight: normal;
}
.header .fw {
padding-right: 70px;
}
.nav .item {
display: block;
text-align: center;
margin: 0 0 10px;
line-height: 2;
font-weight: normal;
}
.brandlist li {
width: 33.3%;
}
.footer .itemlist .tt {
font-size: 18px;
margin-bottom: 16px;
}
.footer .itemlist .links a {
font-size: 14px;
}
.footer .itemlist .links a+a {
margin-top: 12px;
}
.footer .iconlist li+li {
margin-top: 18px;
}
.aboutus .pic .icon1,
.aboutus .pic .icon2,
.aboutus .pic .icon3,
.aboutus .pic .icon4 {
display: none;
}
.aboutus .pic {
padding: 0;
}
.aboutus .brief {
margin-bottom: 30px;
font-size: 16px;
}
.aboutus .title {
font-size: 36px;
margin-bottom: 20px;
}
.product-detail .fw {
display: block;
}
.product-detail .pic {
width: 100%;
max-width: 100%;
text-align: center;
margin-bottom: 30px;
}
.product-detail .con {
margin-left: 0;
}
.product-detail .pic img {
width: 350px;
max-width: 80%;
}
.contact-us .fw {
display: block;
}
.contact-us .left {
width: 100%;
padding: 40px 30px;
}
.contact-us .right {
width: 100%;
}
.contact-us .left .infos {
font-size: 16px;
}
.contact-us .left .infos p+p {
margin-top: 12px;
}
.contact-us .left .tt1 {
margin-bottom: 30px;
}
.probox .fw {
display: block;
}
.probox1 .icon {
text-align: center;
width: 100%;
}
.probox2 .icon {
text-align: center;
width: 100%;
}
.probox .icon img {
width: 200px;
max-width: 40%;
}
.probox .name {
font-size: 32px;
}
.probox .brief {
font-size: 14px;
margin: 20px 0;
}
.pricacy .fw {
display: block;
}
.pricacy .left {
display: flex;
flex-wrap: wrap;
width: 100%;
}
.pricacy .left a {
padding-left: 12px;
}
.pricacy .right {
margin-left: 0;
margin-top: 20px;
}
.pricacy .title {
font-size: 20px;
padding: 15px;
}
.pricacy .inbox {
padding: 20px 15px;
}
.pricacy .inbox .t0 {
font-size: 20px;
}
.pricacy .inbox {
line-height: 1.5;
}
.abox1 .wrap {
display: block;
margin-bottom: 50px;
}
.abox1 .wrap .pic {
width: 100%;
padding-top: 0;
margin-bottom: 20px;
}
.abox1 .wrap .brief {
padding-left: 0;
width: 100%;
font-size: 15px;
line-height: 1.6;
}
.abox1 .list li {
width: 50%;
padding: 0 12px;
}
.abox1 .list {
margin: 0 -12px;
}
.aboutwrap .abox1 {
padding-top: 60px;
}
.abox2 .fw {
display: block;
}
.abox2 .left {
width: 100%;
margin-bottom: 30px;
}
.abox2 .right {
width: 100%;
text-align: center;
}
.morelist li {
padding: 0 10px;
margin-bottom: 20px;
}
.morelist {
margin: 60px -10px 0;
}
.common-title p {
font-size: 30px;
}
.morelist li .ww {
padding: 40px 10px 20px 20px;
}
.morelist li .icon {
left: 20px;
}
}
js代码
$(function() {
// 导航展开收回
$('.navbtn').click(function() {
$('body').toggleClass('open')
})
// 下拉语言
$('.language .item').mouseenter(function() {
if ($(this).hasClass('on')) {
$(this).removeClass('on');
$(this).next().slideUp()
} else {
$(this).addClass('on');
$(this).next().slideDown()
}
})
$('.language').mouseleave(function() {
$('.language .item').removeClass('on');
$('.language .list').slideUp()
})
})