A new type of rattle-type structure with a porous shell was prepared via a simple template strategy in the case of SnO2, which showed high response and good selectivity to ethanol.