如何在文件路径中使用ID?

I have seen that many websites use ids in file paths like so: https://example.com/name#id/example like in https://alexa.amazon.com/spa/index.html#skills/?ref-suffix=nav_nav I can't understand how to use that please help

评论
  • 秋香先生
    秋香先生 回复

    url #id scrolls to the element which has the corresponding id:

    eg: https://stackoverflow.com/questions/61410605/how-to-use-ids-in-file-paths#footer
    

    this will scroll this page to the footer -> click-here

    因此,您必须使用ID包装所需的组件,然后调用:

    yoururl.com/page#id