js 实现选项卡功能
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小米选项卡</title>
<style>
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
ul {
list-style: none;
}
h1,h2,h3,h4,h5,h6 {
font-weight: normal;
}
body {
background-color: #f5f5f5;
}
.tab {
width: 978px;
}
.tab .tit {
height: 40px;
line-height: 40px;
}
.tab .tit .a-wrapper {
float: right;
}
.a-wrapper a {
color: #666;
margin-left: 20px;
}
.a-wrapper a.active {
color: #FF7416;
border-bottom: 2px solid #FF7416;
}
.content li {
width: 234px;
height: 300px;
background: #fff;
text-align: center;
float: left;
margin-right: 14px;
position: relative;
top: 0;
}
.content li:last-child {
margin-right: 0;
}
.content li:hover {
top: -2px;
box-shadow: 0 15px 30px #ccc;
transition: 0.3s;
}
.content .img-wrapper img {
width: 160px;
}
.co