What is the difference between a window and a wall that makes a wall opaque but a window transparent, in terms of the molecules that make them up?
If you imagine the electron clouds of the materials' atoms to oscillate in reaction to traversing electromagnetic waves, there is - depending on the material - a certain frequency range where resonance occurs (imagine the vibrating clouds to behave like a spring...). If resonance occurs, the material is therefore able to dissipate the electromagnetic energy of the incoming electromagnetic wave, i.e. the electromagnetic wave is absorbed. The resonance frequency of glass windows is in the UV regime, not in the visible range. If your eyes would be sensitive only to electromagnetic radiation in the UV regime, a glass window would look solid.