Html
    Css
    Js

    
                        
* {
	margin:0;
	padding:0;
}
ul li {
	list-style:none;
}
.wrap {
	width:530px;
	height:530px;
	background:#ddd;
	margin:100px auto;
	padding-top:20px;
}
.wrap > p {
	text-indent:1em;
	font-size:25px;
	font-weight:bold;
	color:#fff;
}
.wrap .list {
	position:relative;
	margin:50px 0 0 100px;
}
.wrap .list li {
	float:left;
}
.wrap .list li input {
	position:relative;
	z-index:-1;
}
.wrap .list li label {
	display:block;
	width:80px;
	height:50px;
	background:#6A9E52;
	text-align:center;
	line-height:50px;
	font-size:18px;
	color:#fff;
	cursor:pointer;
	border-radius:3px 3px 0 0;
	border:10x solid #6A9E52;
	transition:.3s;
}
.wrap .list li input:checked ~ div {
	display:block;
}
.wrap .list li input:checked + label {
	margin-top:-5px;
	padding-top:5px;
	background:#376B1F;
}
.wrap .list li label:hover {
	background:#508437;
	text-decoration:underline;
}
.wrap .list li div {
	position:absolute;
	top:68px;
	left:-40px;
	width:400px;
	height:220px;
	background:#376B1F;
	padding-top:20px;
	display:none;
}
.wrap .list li div p {
	margin:10px 0 20px 20px;
	color:#fff;
	font-size:18px;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

纯css选项卡切换

纯CSS+html写的哦,代码思路就这样,需要别的样式可以自己设置

0