The present invention relates to a cosmetic composition, especially a hair composition, comprising at least one anionic or nonionic associative polymer, at least one fixing polymer and at least one nonionic surfactant comprising predominantly fatty chains having from 8 to 14 carbon atoms, the weight content of nonionic surfactants comprising predominantly fatty chains having from 8 to 14 carbon atoms in the composition being greater than or equal to 2%.