Objective To investigate the association between dietary and some other environmental factors and the risk of inflammatory bowel diseases (IBD) in Chinese population. Materials and methods A multicenter case-control study was conducted involving 11 hospitals across China. A total of 1,230 subjects were enrolled consecutively, and diet and environmental factor questionnaires were collected. IBD patients were matched with healthy controls (HC) using propensity-score matching (PSM) at a 1:1 ratio with a caliper value of 0.02. Multivariate conditional logistic regression analyses were performed to evaluate the associations between diet, environmental factors, and IBD. Results Moderate alcohol and milk consumption, as well as daily intake of fresh fruit, were protective factors for both Crohn's disease (CD) and ulcerative colitis (UC). Conversely, the consumption of eggs and chocolate increased the risk of IBD. Outdoor time for more than 25% of the day was a protective factor only for CD. In eastern regions of China, CD patients had higher egg consumption and less outdoor time, while UC patients consumed more chocolate. IBD patients from urban areas or with higher per capita monthly income consumed more fruit, eggs, and chocolate. Conclusions This study reveals an association between specific foods, outdoor time, and the emergence of IBD in the Chinese population. The findings emphasize the importance of a balanced diet, sufficient outdoor time and activities, and tailored prevention strategies considering regional variations.