In this study a copolymer poly(styrene-co-allyl-alcohol), [-CH2CH(C6H5)-](x)[-CH2CH-(CH2OH)-](y) has been employed as a novel template in a sol-gel synthesis process to direct the formation of mesoporous tungsten oxide. The copolymer, due to its rigid hydrophobic block of polystyrene, is a more effective surfactant in an alcohol solution than polypropylene oxide-polyethylene oxide based compounds. The films have been prepared by a spin-coating technique from an ethanol solution of tungsten hexachloride. A room temperature, ultraviolet illumination method has been found to be very suitable for removing the polymer template, leading to the formation of a high-quality mesoporous structure. The electrochromic and optical properties of the mesoporous films are described and compared to standard sol-gel tungsten oxide films. Mesoporous materials exhibit superior high-rate ion-insertion performance when used as electrochromic layers. (C) 2003 Elsevier B.V. All rights reserved.