利用锚点再点事吧丨
上图
接着HTML代码:
<div id="color">
<div id="red">红</div>
<div id="yellow">黄</div>
<div id="black">黑</div>
<div id="green">绿</div>
</div>
<a href="#red">红</a>
<a href="#yellow">黄</a>
<a href="#black">黑</a>
<a href="#green">绿</a>
css样式:
#color{
overflow:hidden;
}
div{
height:400px;
width:400px;
}
#red{
height:400px;
width:400px;
background-color:red;
}
#yellow{
height:400px;
width:400px;
background-color:yellow;
}
#black{
height:400px;
width:400px;
background-color:black;
}
#green{
height:400px;
width:400px;
background-color:green;
}