Why do salts containing magnesium ions give no colour in flame test?
Flame tests depend on atoms (or ions) having their eelectrons excited to a higher energy level (accomplished by the application of hest). Once in their excited state, the electrons will quickly fall back to their ground state, emitting the energy we put in as light. The color of the light is what you see in the flame test and depends on the energy levels of the electrons in the atom. It just so happens that when electrons in Mg go back to their ground state they give off light that we cannot see, so Mg does not give a visible color. There are those that do, such as Na (bright orange) and Sr (red) or Cu (green).