Research in environmental education adopts a broad concept of environmental literacy, recognizing the multifaceted nature that encompasses cognitive, affective, and behavioral components. However, minimal research has examined how these components interact with each other across various cities. The present study aims to fill this gap by investigating the interplay between the components of environmental literacy, such as affiliation with nature, environmental knowledge, and environmental behavior. More importantly, the study explores how these relationships vary across different cities that differ in sustainable development levels. Children (N = 979, M age = 11.13) from 29 cities in China completed measures of affiliation with nature, environmental literacy, and pro-environmental behavior (PEB). We classified the cities into high versus low sustainable development levels using the Low-Carbon and Green Index – a comprehensive measure of sustainable development, including energy consumption, carbon emissions, and public policy. A moderated mediation analysis revealed that environmental knowledge mediated the relation between affiliation with nature and PEB only in cities with higher sustainable levels. As a result, environmental education should be tailored to a city’s sustainable development level to better encourage pro-environmental behavior.