html code
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.tab-box {
border: 2px solid greenyellow;
}
/* display: flex弹性盒子,水平方向*/
.tab-head {
display: flex;
}
/* flex-grow生长为100%*/
.tab-head-div {
flex-grow: 1;
text-align: center;
background: green;
border-right: 1px solid white;
line-height: 40px;
}
.tab-head-div.current {
background: wheat;
}
.tab-body-div {
display: none;
}
.tab-body-div.current {
display: block;
}
</style>
</head>
<body>
<div class="tab-box">
<div class="tab-head">
<div class="tab-head-div current" onclick="selectTab(0)">标签一</div>
<div class="tab-head-div" onclick="selectTab(1)">标签二</div>
<div class&