Urban environments and cardiovascular health are closely linked, yet only a few specific exposures have been explored in isolation and mostly adopting cross-sectional design. The influence of socioeconomic status and genetic predisposition also remains unclear. Hence, leveraging the UK Biobank data (n = 206,681), we conducted a prospective analysis of 213 urban environmental variables and their association with atherosclerotic cardiovascular disease (ASCVD). The ExWAS and regularized Cox models analyses highlighted air pollution, industrial sites, and complex street networks as primary environmental risk factors. Instead, land-use density of leisure, public services, infrastructure and residential, and drinking water hardness showed a negative association with ASCVD risk. By integrating sparse canonical correlation and mediation analyses, we found distinct urban environment patterns through diverse pathways influence ASCVD. The environment characterized by pollution and complex streets impact ASCVD through adverse mental health (mediation proportion:30.7 %, 95 % CI:22.4 %-44.0 %), while highly-developed community and high-water hardness environment via cardiometabolic status (22.6 %, 95 % CI:19.7 %-26.0 %). Further, we found low socioeconomic status amplifies disadvantaged urban environment effects on ASCVD, yet there were no similar findings for ASCVD genetic predisposition. This research deepened our understanding of city-cardiovascular health links and the role of socioeconomic status, with implications for urban planning and public health interventions.