最简单的方法是锚点用<a>标签,在href属性中写入DIV的id。如下:

<!DOCTYPE  html>
<html>
<head>
    <style>
        div {
            height: 800px;
            width: 400px;
            border: 2px solid black;
        }
        h2 {
            position: fixed;
            margin:50px  500px;
        }
    </style>
</head>
<body>
    <h2>
        <a href="#div1">to div1</a>
        <a href="#div2">to div2</a>
        <a href="#div3">to div3</a>
    </h2>
    <div 跳转
 
  

相关文章:

  • 2021-05-06
  • 2021-04-09
  • 2021-09-07
  • 2022-12-23
  • 2022-01-13
  • 2021-09-14
  • 2021-12-12
猜你喜欢
  • 2021-08-20
  • 2022-12-23
  • 2021-10-26
  • 2021-09-19
相关资源
相似解决方案