定义好容器id,在<a>标签中的href中用“#+id”就实现跳转了。
<a href="#ct1">跳转到词条1</a> <a href="#ct2">跳转到词条2</a> <br> <div id="ct1" style="height:1000px;"><a href="#">词条1</a></div> <div id="ct2" style="height:1000px;"><a href="#">词条2</a></div>
显示效果:
Powered by: 博客园 Copyright © 2024 KroLong Powered by .NET 8.0 on Kubernetes