Stainless steel is a highly corrosion resistant steel, as the chromium or other alloying metals it contains have a high affinity for oxygen and react with it to form a protective layer, thus preventing corrosion of the iron. However, this layer can be affected by some acids, resulting in the iron being attacked and oxidised by intergranular mechanisms or generalised pitting. Some types of stainless steel also contain other alloying elements, the main ones being nickel and molybdenum.