The inverse opal films of SiO2 containing metal nanoparticles can have both the localized surface plasmon resonance (LSPR) of metal nanoparticles and the Bragg diffraction of inverse opal crystals of SiO2, which are very useful properties for applications, such as tunable photonic structures, catalysts and sensors. However, effective processes for fabrication of these films from colloidal particles have rarely been reported. In our study, two methods for preparation of inverse opal films of SiO2 with three different crystal sizes and containing gold or silver nanoparticles (NPs) via self-assembly using electrostatic interactions and capillary forces are reported. The Bragg diffraction of inverse opal films of SiO2 in the presence and absence of the template was measured and predicted on the basis of with UV–vis spectroscopy and scanning electron microscopy. The preparation methods used provided good-quality inverse opal SiO2 films containing highly dispersed, plasmonic AuNPs or AgNPs and having both Bragg diffractions and LSPRs.