Composition containing, in a cosmetically acceptable medium, at least 2.5% by weight of one or more volatile linear alkanes relative to the total weight of the composition, and one or more cationic surfactants, where the volatile linear alkane(s)/cationic surfactant(s) weight ratio is less than or equal to 1.5. Use of this composition for the treatment of keratin materials, preferably the hair.