This matters mostly when we use java-script or jQuery. most of the time for links we use # to set empty url and run jquery onclick. but sometimes page scrolls up due to use of # tag.
you can easily prevent href=”#” taking you to top of page by using bellow code.
You can use fault ID like href=”#dsdposdsd”. In this case it try to find the ID but since ID is fake it stops at same position.