How can glass be transparent?
The vast majority of materials are not transparent, as they either reflect or absorb light. The leaves of trees are green, as the red and blue colours of the light are absorbed, whereas the green colour is reflected. On the other hand, window glass is transparent, as light of the wavelengths that are visible to us pass through the material.
A photon (light particle) is only absorbed by an object if it is able to supply an electron with so much energy that it is elevated into a higher energy state. In transparent materials, the atoms are packed in such a way that the visible light does not have sufficient energy to affect the electrons, and pass through the material instead.