Abstract:“Ideological and political education in class” is the requirement of higher education in the New Era. “Teach in every process, with everyone, in every aspect” is the inevitable goal of higher education in the field of civil engineering. Considering the underdevelopment of ideological and political education in universities, we dived deep into the ideological and political elements in civil engineering major based on the ethics and morals in the civil engineering profession. We clarified the training objective in the civil engineering major with the visual field of “fostering character and virtue” and constructed a “three-dimensional, multi-level, all-inclusive” teaching system so that ideological and political education is more targeted and effective. We proposed multiple, original, interesting, and flexible teaching methods to compensate for the existing stale teaching mode. We took the national online course Soil Mechanics and Foundation Engineering as an example, explored and experimented with our teaching methods to infuse the ideological and political elements in this professional core course from three aspects: course content, teaching modes, and course evaluation, and hope this paper can be used as a reference for the future development of ideological and political education in civil engineering core courses.