Home  >  Q&A  >  body text

anchor link

After I edited #Baidu Pictures, I clicked "Baidu Pictures" to jump to the bottom picture, but when I refreshed the page directly again, the page jumped directly to the picture below without stopping at the top of the page. How can I make the page stay at the top after refreshing it directly, and it can only be jumped by clicking on "Baidu Pictures"? If you don't click and just refresh, it will not jump?

李东泽李东泽2204 days ago1323

reply all(2)I'll reply

  • colonel

    colonel2018-10-08 15:41:01

    Cannot be refreshed directly, because when you clicked on a Baidu image before, the address on your browser already pointed to your anchor point

    For example

    Your previous browsing The browser access address is http://127.0.0.1/demo1.html

    If your anchor address is baidu

    , then after you click to successfully jump to the anchor point, your browser The access address becomes http://127.0.0.1/demo1.html#baidu

    So no matter how you refresh it at this time, it will directly display the position of your anchor point instead of displaying the page header

    reply
    1
  • 李东泽

    Thank you~

    李东泽 · 2018-10-09 21:22:00
  • Cancelreply