Optical properties of mesoporous three-dimensional photonic crystals (3D PCs) based on thin opal films were found to be extremely sensitive to a humidity of the surrounding air. It was manifested that the internal structure of a single SiO2 sphere together with the net of voids between them in a thin opal film acts as a sponge for wet steams. Our experimental data have shown that hydrophilic internal structure of a mesoporous film sponges up (and lose) water (dry or wet steams) that influences dielectric permittivity, the latter causes significant changes in transmission spectra. High sensitivity, quick response and possibility of contactless measurements makes sensors based on optical effects in mesoporous PCs to be very promising. It concerns not only humidity sensors, but also sensors of various gases, temperature, deformation and other environmental impacts.