An optical element having a substrate and a light-shielding film on part of an outer portion of the substrate further contains a coating on the light-shielding film, the coating containing a cured mixture of a melamine or benzoguanamine resin, and a phenolic resin, in proportions by mass of 1:5 to 7:5.