Hello there,
WTF?
Let's get you in tune, then we will try to figure out what is going on with your tuner. First to get tuned to the proper pitch, use this video.
http://www.youtube.com/watch?v=cxhxIV0I5T8&feature=related
If you followed that guy's video, you have your guitar tuned to the proper pitch. Now I want to show you about relative tuning. If you get your low E (thickest string) tuned to the proper pitch, you can tune the rest of the strings. That is what you were doing when you fretted it at the 5th fret. Fret the low E (thickest) string at the 5th fret. Now pluck the low E string and tune the next string (the A string) to the pitch of the low E string at the 5th fret. Now the A string is tuned. Repeat this for the next string over. Fret the A string at the 5th fret and tune the next string (D string) to the pitch of the A string at the 5th fret. Now for the G string. Fret the D string at the 4th fret and tune the G string to that pitch. Now fret the G string at the 5th fret and tune the B string to that pitch. B string is tuned. Now for the last string, the thinnest string is the high E string. Fret the B string at the 5th fret and tune the high E string to that pitch.
Now about your electronic tuner. Here is where I do not understand what you are trying to do. You said your machine heads (tuning pegs) are lined up with the string. On the screen of your tuner there should be arrows, bars or sometime that light up. Probably red and green. Typically if the pitch of the string is flat (too low) or sharp (too high) the indicator is red. When it is in the proper pitch it is green. You machine heads may or may not line up with anything. If they do it is a coincidence. Forget about where the tuning pegs face. Turn the machine head until the screen of your electronic tuner says that string is in pitch.
Now for some problems you may come across. Sometimes a string will catch in the nut. As you turn the machine head, the string does not slide through the nut and the pitch of the string does not change. Then all of a sudden the string breaks free and slides. The pitch jumps far more than you expected. To fix that. Lubricate the string in the nut. Take a lead pencil and rub the lead in the slot of the nut. The graphite in the pencil lead works well to lubricate the slot.
You put on new strings and tune all the strings. When you start playing and they go flat very fast. New strings stretch. If you did not stretch them as you put them on, they will stretch as you play them. That could last any where from a couple hours up to a couple days. While the strings are stretching you do have to tune them frequently.
Some times you tune a string and then it goes flat when you play it. There can be a couple reasons for this. One reason is the machine head may be slipping. The more common reason is that the string is not wrapped onto the tuning peg correctly and is slipping. You want a downward pressure with the wraps to hold the string firmly in place.
Some times you start tuning the strings and by the time you have finished tuning the last strings, the first strings are now flat. This is common with tremolo bridges. You need to set up your tremolo so it floats properly and holds the correct amount of tension on the strings. Then when you tune the strings they will stay in tune.
One tip for using the electronic tuner. When you pluck a string to test its pitch, mute the adjacent strings. That prevents them from vibrating and you get a clean sound from the string you are tuning.
Later,