How to have a URL With a Query String and Focuses on Element?

后端 未结 1 1994
北海茫月
北海茫月 2021-01-23 17:00

In the URL, you can focus on a particular element by appending a \'#\' and its id. For example:

http://stackoverflow.com?#footer

The code above

相关标签:
1条回答
  • 2021-01-23 17:25

    The correct syntax is:

    http://stackoverflow.com?id=3#footer
    

    Everything after the # is client-side, which is why it comes last.

    If this does not work, you would need to post more of your code, as the problem would then be with how you are handling the query string parameter and/or whether you have the anchor in your HTML.

    0 讨论(0)
提交回复
热议问题