Post by email@example.com
I see in the literature that most crystals that are transparent at room
temperature have the elements oxygen, carbon, or fluorine in them.
Please comment on any general rule for transparent compounds.
Your conclusions may reflect your sampling procedures. KBr, for example, is transparent and is used to make windows and other optical elements in spectrometers. Lots of transition-metal crystals, while coloured, are transparent across at least some of the optical range. And there are clear counterexamples, such as graphite, which is just an allotrope of carbon. The truly opaque materials that come to mind are metals and network solids (graphite, boron, silicon, ceramics, etc.), but some network solids (e.g. quartz) are clear.
You will note that many opaque materials are conductive to a greater or lesser extent, which isn't a coincidence. A material with metallic conductivity should be reflective, and therefore opaque, according to the theory of metals. Semiconductors, which have medium-sized bandgaps, will be opaque if the bandage is smaller than the energy of optical photons because they will absorb these photons.
Insulators, on the other hand, have bandgaps larger than the frequency of an optical photon, and so will tend to be transparent. The situation with transition-metal compounds is best thought of slightly differently by thinking about d to d transitions of the metals in a given environment, but again, they typically don't absorb right across the spectrum and so are transparent at some optical frequencies.
Ceramics are a slightly different story. They are usually insulators, but common ceramics are opaque because of their irregular microscopic structure, which scatters light.
So as a rule, if you want a material to be transparent, look for insulating materials. If you additionally want it to be clear, stay away from transition-metal compounds, other than those with d^0 or d^10 electronic configurations.