运行效果如下图:
css部分:
<style>
* {
margin: 0;
padding: 0;
list-style: none;
}
a {
text-decoration: none;
}
ul {
display: flex;
flex-direction: column;
}
.container {
width: 500px;
margin: 100px;
position: relative;
}
strong {
margin: 45px;
font-size: 20px;
}
.title {
display: flex;
align-items: center;
width: 200px;
background-color: #fff;
}
.title li {
margin: 10px;
flex: 1;
cursor: pointer;
user-select: none;
height: 30px;
line-height: 30px;
color: #666;
margin-bottom: 40px;
border-bottom: 3px solid #fff;
}
.title li:hover {
border-bottom: 3px solid #00A862;
color: rgba(46, 44, 44, 0.87);
font-weight: 700;
}
.title>li.active {
color: rgb(180, 47, 47);
}
.content {
position: absolute;
top: 0;
left: 250px;
background: rgb(245, 245, 245);
width: 800px;
height