Three kinds of amino-functional mesoporous silica thin films (AF-MSTFs) have been directly synthesised by the sol-gel dip coating. The Fourier transform infrared spectra show that the amino groups are introduced into the nanopores of AF-MSTFs successfully by co-condensation technology. The X-ray diffraction (XRD) and transmission electron microscope (TEM) characterisations find that the AF-MSTFs prepared by different surfactants have highly ordered mesostructures with different nanopore sizes and morphologies. By using AF-MSTFs as templates, associated with neutralisation reaction and hydrogen reduction, gold nanoparticles (GNPs) are formed well within the mesostructures with a narrow size distribution, which is verified by the observation of XRD, TEM and energy-dispersive X-ray analyses. Ultraviolet-visible spectra of the nanocomposites are additional evidence of the existence of GNPs. What is more, they imply that the size effect of GNPs and the structure variation of AF-MSTFs can modulate the optical properties of the nanocomposites.