Rhythm in literature refers to the way poets arrange stressed and unstressed syllables in lines of verse. The repetition of this arrangement or rhythm in multiple lines creates a musical quality in poetry. Rhythm is spoken of in terms of meter, which refers to a line's length in syllables. Two or three syllables combine to make a foot and there are varying numbers of feet in each line of poetry, especially in more traditional forms, such as the sonnet. In the English language there are many kinds of feet used in poetry.
The most common type of meter uses iambs, which are sets of two syllables in which only the second is stressed. An example of an iamb is the word "compare," in which the sound of the second syllable is stressed more strongly than that of the first. Shakespeare's sonnets were written in iambic pentameter, which means he composed each line with five iambs. Consider the following example, in which the stress falls on every other syllable:
"Shall I compare thee to a summer's day?"
A trochee is another type of poetic foot commonly used in English. Here the first syllable is stressed, such as in the word "awful." Henry Wadsworth Longfellow wrote his "Psalm of Life" in trochaic tetrameter, which means it's composed of lines of four trochees each. Consider the opening line from that poem and note how the stress falls on the odd numbered syllables:
"Tell me not, in mournful numbers,"
Spondees are poetic feet in which two consecutive syllables are stressed. It would be difficult, to say the least, to construct a line of verse entirely from spondees, so these feet are used sparingly as variations within lines that a poet forms with other rhythms. G.K. Chesterton used a spondee to begin the first line of his poem "Lepanto":
"White founts falling in the Courts of the sun,"
Not all poetic feet are two syllables in length. The dactyl is a foot composed of three syllables, only the first stressed. The word "marvelous" is a good example. Longellow wrote his poem "Evangeline" in dactylic hexameter, which means lines of six dactyls:
"This is the forest primeval. The murmuring pines and the hemlocks,"
Note that the last foot (hemlocks) is not a dactyl. Many poems use a particular rhythm as a guide but occasionally stray from it.
Anapests are the opposite of dactyls -- three syllables with the last stressed. A famous example of anapestic tetrameter is the poem, "A Visit from St. Nicholas." Notice how every third syllable is stressed.
"Twas the night before Christmas, and all through the house,"