After loading a page, a browser automatically scrolls to the element identified by its id in the fragment part of the URL. It does the same when you click on an anchor with an href
of the kind #element-id
.
When you load a page using the URL https://example.com/#header
it should automatically scroll the element with the id header
into the view. Note that recently, chromium-based browsers support text fragments to highlight a part of the page. The URL looks like https://example.com/#element:~:text=demo
.
The second behavior is when you click on a link which only set the fragment, the browser should navigate to the element:
<a href="#header">#example</a>
#blazor #.net #asp.net core #web