效果图
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/swiper.min.css">
<script src="js/flexible.js"></script>
<title>黑马面面</title>
</head>
<body>
<section class="warp">
<!-- 头部区域--------------start -->
<header class="header">黑马面面</header>
<!-- 头部区域--------------end -->
<!-- 导航栏模块-----------------start -->
<nav class="nav">
<a href="#" class="item">
<img src="icon/icon1.png" alt="">
<span>HR面试</span>
</a>
<a href="#" class="item">
<img src="icon/icon2.png" alt="">
<span>笔试</span>
</a>
<a href="#" class="item">
<img src="icon/icon3.png" alt="">
<span>技术面试</span>
</a>
<a href="#" class="item">
<img src="icon/icon4.png" alt="">
<span>模拟面试</span>
</a>
<a href="#" class="item">
<img src="icon/icon5.png" alt="">
<span>面试技巧</span>
</a>
<a href="#" class="item">
<img src="icon/icon6.png" alt="">
<span>薪资查询</span>
</a>
</nav>
<!-- 导航栏模块-----------------end -->
<!-- go模块-----------------start -->
<secrion class="go">
<img src="image/go.png" alt="">
</secrion>
<!-- go模块-----------------end -->
</section>
<!-- 就业指导模块----------------start -->
<section class="content">
<!-- 头部 -->
<div class="con-hd">
<h4>
<span> <img src="icon/i2.png" alt="" class="icon"></span>
就业指导
</h4>
<a href="#" class="more">更多>></a>
</div>
<!-- 旋转木马轮播图--------------- -->
<div class="get_job_focus ">
<!-- Swiper -->
<div class="swiper-container get_job_fo">
<div class="swiper-wrapper">
<div class="swiper-slide">
<a href="#"><img src="./image/pic.png" alt=""></a>
<p>老师教你应对面试技巧</p>
</div>
<div class="swiper-slide">
<a href="#"><img src="./image/3.jpg" alt=""></a>
<p>老师教你应对面试技巧</p>
</div>
<div class="swiper-slide">
<a href="#"><img src="./image/ldh.jpg" alt=""></a>
<p>老师教你应对面试技巧</p>
</div>
</div>
</div>
<!-- 左右箭头 -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
</section>
<!-- 充电学习模块----------------- -->
<section class="content">
<!-- 头部 -->
<div class="con-hd">
<h4>
<span> <img src="icon/i2.png" alt="" class="icon"></span>
充电学习
</h4>
<a href="#" class="more">更多>></a>
</div>
<!-- 学习模块轮播图 -->
<div class="study">
<div class="swiper mySwiper study_con">
<div class="swiper-wrapper">
<div class="swiper-slide">
<a href="#"><img src="./image/pic1.png" alt=""></a>
<h5>说地道英语,告别中式英语</h5>
<p>156人学习</p>
</div>
<div class="swiper-slide">
<a href="#"><img src="./image/pic1.png" alt=""></a>
<h5>说地道英语,告别中式英语</h5>
<p>156人学习</p>
</div>
<div class="swiper-slide">
<a href="#"><img src="./image/pic1.png" alt=""></a>
<h5>说地道英语,告别中式英语</h5>
<p>156人学习</p>
</div>
<div class="swiper-slide">
<a href="#"><img src="./image/pic1.png" alt=""></a>
<h5>说地道英语,告别中式英语</h5>
<p>156人学习</p>
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
</section>
<script src="./js/flexible.js"></script>
<script src="./js/swiper.min.js"></script>
<!-- Initialize Swiper -->
<script>
// function js局部变量
// 旋转木马js
(function () {
var swiper = new Swiper('.get_job_fo', {
// 显示出的图片个数范围
slidesPerView: 2,
// 每一个图之间的距离
spaceBetween: 30,
// 大图显示位置
centeredSlides: true,
loop: true,
// 添加左右箭头
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
})();
// 学习模块js
(function () {
var swiper = new Swiper(".study_con", {
slidesPerView: 2.3,
spaceBetween: 30,
})
})();
</script>
<!-- 就业指导模块---------------end -->
<!-- footer模块----------------start -->
<footer class="footer">
<a href="#" class="item">
<img src="./icon/home.png" alt="">
<p>首页</p>
</a>
<a href="#" class="item">
<img src="./icon/ms.png" alt="">
<p>模拟面试</p>
</a>
<a href="#" class="item">
<img src="./icon/net.png" alt="">
<p>技术面试</p>
</a>
<a href="#" class="item">
<img src="./icon/user.png" alt="">
<p>我的主页</p>
</a>
</footer>
<!-- footer模块----------------end -->
</body>
</html>
CSS
body {
min-width: 320px;
max-width: 750px;
margin: 0 auto;
background-color: #f2f4f7;
}
a {
text-decoration: none;
color: #707070;
}
// 约束当屏幕大于750px时 html字体就不变化了
@media screen and (min-width:750px) {
html {
font-size: 37.5px !important;
}
}
// 头部区域--------------start
.warp {
background-color: #fff;
padding-bottom: 1.1467rem;
}
.header {
height: 2.1333rem;
border-bottom: .0267rem solid #eaeaea;
text-align: center;
line-height: 2.1333rem;
font-size: .9333rem;
color: #1c1c1c;
}
// 头部区域--------------end
// 导航栏模块-----------------start
.nav {
display: flex;
flex-wrap: wrap;
padding: 1.2rem 0 1.6rem 0;
.item {
display: flex;
width: 33.33%;
// 主轴方向设为y轴
flex-direction: column;
// 设置侧轴元素排列方式为居中
align-items: center;
img {
width: 3.706667rem;
height: 3.706667rem;
}
span {
font-size: .6667rem;
color: #707070;
}
&:nth-child(-n+3) {
margin-bottom: 1.6533rem;
}
}
}
// 导航栏模块-----------------end
// go模块-----------------start
.go {
margin: 0 .3733rem;
img {
width: 19.2533rem;
height: 4.0533rem;
}
}
// go模块-----------------end
// 就业指导模块----------------start
.content {
padding: 1.0667rem .64rem;
margin-top: .2667rem;
background-color: #fff;
// 头部
.con-hd {
display: flex;
// 主轴方向上元素两侧对齐
justify-content: space-between;
height: 1.0133rem;
line-height: 1.0133rem;
h4 {
margin: 0;
font-size: .7467rem;
color: #333;
.icon {
display: inline-block;
width: 1.0133rem;
height: 1.0133rem;
vertical-align: middle;
}
}
a {
font-size: .5867rem;
color: #999;
}
}
// 旋转木马轮播图------------------
.get_job_focus {
position: relative;
.swiper-container {
width: 14.4rem;
height: 100%;
margin-top: .9067rem;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
// 竖向显示
flex-direction: column;
transition: 300ms;
// 其他元素大小
transform: scale(0.8);
// 透明度
opacity: 0.4;
a {
width: 9.0133rem;
height: 10.0267rem;
img {
width: 100%;
height: 100%;
}
}
p {
width: 9.0133rem;
font-size: .6667rem;
margin-top: .64rem;
color: #333;
}
}
// 当前选中元素大小
.swiper-slide-active,
.swiper-slide-duplicate-active {
transform: scale(1);
z-index: 7;
opacity: 1;
}
}
}
// 学习模块轮播图-------------
.study_con {
padding-bottom: .8rem;
overflow: hidden;
}
.study {
.study_fo {
padding: .5333rem;
}
.swiper-slide {
font-size: 18px;
background: #fff;
width: 7.7333rem;
height: 9.0667rem;
border-radius: 0.26667rem;
box-shadow: 0 0px .2667rem rgba(0, 0, 0, 0.1);
background-color: #fff;
h5 {
font-size: .7467rem;
margin: .5333rem 0;
font-weight: 400;
padding: 0 .2667rem;
}
p {
font-size: .6933rem;
color: #f40;
padding: 0 .2667rem;
}
}
}
// 就业指导模块----------------end
// footer模块----------------start
.footer {
display: flex;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 2.9333rem;
z-index: 999;
padding: .5333rem;
border-top: 1 px solid #ccc;
background-color: #fff;
.item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
img {
width: 1.04rem;
height: 1.0933rem;
}
p {
font-size: .5867rem;
color: #666;
margin-top: .2667rem;
}
}
}
// footer模块----------------end