<!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">
<style>
.box {
height: 100px;
}
.content {
width: 100%;
height: 30px;
overflow: hidden;
}
.cont {
width: 100%;
height: 30px;
}
#one {
background-color: white;
}
#two {
background-color: pink;
}
#three {
background-color: red;
}
</style>
</head>
<body>
<div class="box">
<a href="#one">按钮1</a>
<a href="#two">按钮2</a>
<a href="#three">按钮3</a>
<div class="content">
<div id="one" class="cont">内容1</div>
<div id="two" class="cont">内容2</div>
<div id="three" class="cont">内容3</div>
</div>
</div>
</body>
</html>