To shape E, press your index finger directly behind the first fret of the fourth (G) string. This is known as fretting. Press your ring finger behind the second fret of the third (D) string, and your middle finger behind the second fret of the second (A) string. To sound E major, strum through all six strings, leaving the first (low E), fifth (B) and sixth (high E) strings open. By learning how to shape the E major chord and "barring" it, you can play every major note in the musical octave. When fretting, place your fingers as close behind the fret as you can, without touching it.
The bar chord is formed by using your index finger to press down on all six strings behind a fret. Once you do this -- for example on the third fret -- use your ring finger to fret the A string at the fifth fret, your little finger to press down behind the fifth fret of the D string, and your middle finger to hold down the fourth fret on the G string. Because you barred the third fret, copying the E shape and strumming through all six strings now sounds the note G. By moving your bar shape up the fretboard, from the first fret, you can play F, F#, G, G#, A, A#, B, C, C#, D, D#, before reaching E again at the 12th fret.
The chord of A major is shaped by fretting three strings at the second fret: the D string with your index finger, the G string with your middle finger, and the B string with your ring finger. Press down on the fretboard as hard as you can. It's a good idea to keep the nails of your fretting hand as short as possible. To bar the A major shape, use your index finger as described in Section 2, then use your ring finger to press down on the second fret up of the D, G and B strings.
For C major, the ring finger frets the A string at the third fret, the middle finger frets the D string at the second fret, and the index finger is in behind the first fret on the B string. When you sound C major, do not strum through the low E string.
For D, use your index finger to bar the highest three strings (G, B and high E) at the second fret, then fret the B string at third with your middle finger. When playing D, only strum the highest four strings.
G is sounded by fretting the low E string at third with your middle finger, then the A string at second with your index finger, and the high E string at third with your ring finger.