The id attribute may be used to create an anchor at the start tag of any element (including the A element).
Ref: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3
So your solution seems right. I think there might be something else going on (browser unable to scroll to your desired location, margin/padding going wrong) which messes up the scrolling.