4条回答 默认 最新
- 崽崽的谷雨 2022-02-11 17:45关注
html 锚点 了解一下 如果只是悬浮 那固定定位即可 。如果实现 点击跳转到对应位置 ,html锚点可以实现
<!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"> <title>Document</title> <style> .box { width: 50px; } .ml { position: fixed; right: 20px; top: 260px; border: 1px solid red; width: 200px; height: 150px; } /* ul{ list-style: none; } */ ul>li { width: 100%; height: 40px; line-height: 40px; } .vv{ /* margin-top:800px ; */ } </style> </head> <body> <div class="box"> 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 88888888888888888888888888888888888888888899 999999999999999999999999999999999999999999999 99999999999999999999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 9999999999999999999999999999999 <div class="vv"> <a name="001" id="001">001 </a> 111111111111111111111111111111111111111111 111111111111111111111111111111111111111111 11111111111111111111111111111111111111 </div> </div> <div class="ml"> <ul> <li> <a href="#001">跳到001</a></li> <li>444</li> </ul> </div> </body> </html>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 2无用