Let me explain. First, this is the tab for F:
----1---
----3---
----3---
----2---
----1---
----1---
Now, your index finger is laying down, over all 6 of the strings, and your other fingers are forming a backwards 'L' form on the neck, right? Its really ackward at first, but bear with it, in due time you will be comfortable, and will unlock the secret of chords on your guitar neck. Now, the next step:
Moving the chord. Hold the same position as the "f" chord, and move up the neck to where your index finger is laying on the 3rd fret. This chord is..... yup, you guessed it, 'G'.
As long as you hold the same chord position, no matter where you move it to on the guitar neck, it will be the major chord for whatever note your index finger is laying on with the 6th string. In other words, on the 6th string (low E) we know its tuned to 'E' when played open (without fretting at all), and we also know that the guitar neck is 1/2 step per fret, therefore one half step up from E is F, hence the position of the above chord (f). Slide it up two frets (1 whole step) and you have.... yup, G! Two more... Yup, A!....two more... you got it, B!
Welcome to the world of barre chords!