<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<style>
.tab{
width: 600px;
height: 300px;
border:1px solid #000;
margin: 50px auto;
}
.tab ul, .tab ol{
list-style-type: none;
padding: 0;
margin: 0;
}
.tab ul{
height: 50px;
background-color: #eee;
display: flex;
justify-content: space-evenly;
align-items: center;
}
.tab ul li{
width: 100px;
height: 30px;
background-color: #abcdef;
text-align: center;
line-height: 30px;
}
.tab ul li.active{
background-color: #f00;
color: #fff;
}
.tab ol{
width: 600px;
height: 250px;
}
.tab ol li a img{
width: 600px;
height: 250px;
}
.tab ol li{
display:none;
}
.tab ol li.active{
display:block;
}
.tab{
cursor: pointer;
}
</style>
<body>
<div class="tab">
使用jquery实现tab切换
最新推荐文章于 2024-07-29 18:19:14 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)