A large variety of materials for optical and optoelectronic applications has been developed by trapping active organic molecules and nanocrystals into pure inorganic and hybrid organic- inorganic gels. Concerning optically active molecules, we focus only here on luminescent materials for solid state tunable lasers and light-emitting diodes, and photochromic materials for integrated optics and optical storage. Optical properties can be controlled by changing the nature and the intensity of chemical and steric interactions between the organic system and the solid host matrix. Concerning nanocrystals, we present two approaches for the synthesis of transparent solids based on 1I-VI semiconducting nanoparticles. A first category of materials consists in the dispersion of CdS nanoparticles in sol-gel silica matrices. The luminescence can be controlled by offering an alternative pathway for the recombination of surface trapped carriers. A second group of transparent materials is obtained by considering the CdS nanoparticles not only as the optically active units, but also as the building blocks for the whole solid.