Consider a fictitious company, Loadsamoney Ltd, whose shares cost 100p each, which is paying an annual gross dividend  of 10p per year.
The dividend yield is calculated by dividing the dividend by the share price, and then expressing it as a percentage.
In Loadsamoney’s case then, the dividend yield is:
10p/100p x 100 = 10%
Imagine Loadsamoney Ltd announces an exciting new product, which analysts believe will sell spectacularly well and thus results in a huge demand for Loadsamoney’s shares and a doubling of its share price to 200p.
The 10p dividend is the same, so the yield is now:
10p/200p x 100 = 5%
A few months later the product proves a flop, and Loadsamoney Ltd’s share price falls to 125p. However in the interim Loadsamoney has revealed its annual results and increased its dividend payment by 10% for the year, to 11p.
Again, the Dividend Yield = Dividend/Share Price x 100:
11p/125p x100 = 8.8%
The most important point to note is that the dividend yield varies with the share price. All things being equal, a rising share price will reduce the dividend yield, while a falling share price will increase the dividend yield.