Theoretical models of the effects of selection against deleterious mutations on variation at linked neutral sites (background selection) are used to predict the relations between chromosomal location and genetic variability at the DNA level, in Drosophila melanogaster. The sensitivity of the predictions to variation in the mutation, selection and recombination parameters on which they are based is examined. It is shown that many features of the observed relations between chromosomal location and level of genetic diversity in D. melanogaster can be explained by background selection, especially if the weak selective forces acting on transposable elements are taken into account. In particular, the gradient in diversity in the distal portion of the X chromosome, and the lack of diversity on chromosome 4 and at the bases of the major chromosomes, can be fully accounted for. There are, however, discrepancies between predicted and observed values for some loci in D. melanogaster, which may reflect the effects of forces other than background selection.