Despite the mounting evidence that taxonomic diversity dynamics are patterned environmentally and that taxonomic diversity and morphological disparity are decoupled both temporally and spatially in many clades, very little work has been done to assess whether disparity is also influenced by environment. Here I investigate whether trilobite disparity shows environmental patterning through time. I used the method developed by Simpson and Harnik (2009) for estimating latitudinal, substrate, and bathymetric affinities from fossil occurrence data, downloaded from the Paleobiology Database. This method has the advantages that the biological null hypothesis is explicitly separated from the expectation due to sampling, and that the posterior probability can be used to infer degree of preference for one habitat compared to another. To measure morphology, I used a data set of outlines of the trilobite cranidium from Foote (1993). Many of the species in this data set are not represented in the Paleobiology Database in sufficient numbers to assess species-level affinity for these taxa, but species-level affinity could be estimated with high fidelity by using genus-level affinities. Results show that cranidial morphological diversity was structured by environmental preferences of the taxa but the structure was complex and changed through time. In particular, there was little differentiation in morphospace around latitudinal, substrate, or bathymetric affinity during the Cambrian. In contrast, both diversification and expansion into previously unoccupied areas of morphospace during the Ordovician were dominated by tropical, deeper-water taxa.