What do greenhouse gases have in common with carbon dioxide that makes each of them a greenhouse gas?
They all block radiation in the infrared spectrum.
First off, carbon dioxide is a greenhouse gas not apart from them.
Secondly, I am just going to paste an answer I provided earlier here that answers the question.
The Earth is heated by the sun, but the atmosphere is heated by the Earth. Although energy from the sun is in all different wavelengths, the majority is what we generally like to refer to as short wave radiation.
All energy will interact with matter depending on the wavelength of that energy and the type of matter. For example, very short wavelengths like xrays will pass through most matter, but be stopped by things like calcium and lead.
In the case of the Earth and Sun, the shortwave radiation passed through the atmosphere without too much interference and reaches the surface of the Earth. This radiation then heats the Earth. The warmed Earth then radiates energy of it's own. This energy is sensible heat (meaning we can feel it), and is of a longer wave length than the incoming solar radiation. Now things get interesting.
The incoming short wave radiation passes through the atmosphere relatively unaffected, but the outgoing long wave radiation doesn't. The reason for this is greenhouse gases. These gases (carbon dioxide, methane, water vapor, etc.) are transparent to shortwave radiation but opaque to long wave radiation. Essentially they act the same way that the glass walls of a green house act, allowing sunlight to enter the greenhouse but preventing the heat from escaping the greenhouse.