Clicking on a link I don't jump to the **exact** location of the label, just somewhere around it

When I label an equation and later have a reference to it, then by clicking the corresponding link the pdf I jump to that equation, with the equation being exactly at the top of the page. Same goes for footnotes.

But when I just insert a label in the text (for example near a theorem for the purpose to have a link to that theorem in my text) and later in the text have a reference to it and then click on the corresponding link in the pdf, I don't jump exactly to the place where the label was (meaning it isn't at the top of the page like equations ans footnotes anymore), just to right page - with the place where the label was being somewhere around the middle.

What can I do so that the link will send me to the place where the label was, with it being at the top of the page (like for equations) ?

P.S. I use LxY 2.

-
Have you used \usepackage[all]{hypcap} loaded after hyperref package? –  In PSTricks we trust Mar 10 '12 at 11:38
Do you still get to exactly the beginning of the theorem? –  Andrey Vihrov Mar 10 '12 at 11:48
@DamienWalters Didn't work. But the accepted answer did. –  user10324 Mar 16 '12 at 17:46

Links jump to the last anchor. Normally hyperref inserts such anchors at sensible places, but if you want a specific location you must do it yourself.

\documentclass{article}
\usepackage{hyperref,lipsum}

\begin{document}
\section{ABC}
\lipsum[1]

ANCHOR\label{A}\phantomsection\label{B}

\lipsum[2]
\newpage
A: \ref{A} to section title

B: \ref{B} to ANCHOR
\end{document}

-