The invention relates to a medical product, in particular to an externally-applied ointment for treating infantile eczema and a preparation method thereof. The externally-applied ointment comprises the following ingredients in parts by mass: 4-6 parts of humifuse euphorbia herb extract, 5-8 parts of puffball extract, 1-3 parts of squalane, 1 part of glyceryl stearate, 1 part of almond oil, 1 part of phenoxyethanol, 1 part of sodium hyaluronate, 1-3 parts of acrylic resin, 1-3 parts of tocopheryl acetate, 1 part of chlorhexidine gluconate, 25-40 parts of glycerin and 5-15 parts of distilled water. The externally-applied ointment has the functions of cleaning, disinfecting, resisting bacteria, sterilizing and nourishing the skin. Natural substance extracts are adopted, the active ingredients contained in the humifuse euphorbia herb and puffball can be used for effectively treating eczema, and in addition, the skin protection compounds are combined, so that the externally-applied ointment is suitable for cleaning, sterilizing and nursing skin of infants, can effectively restrain and kill skin deep harmful bacteria for infantile eczema and skin itching, and is mild and non-irritant.