The invention discloses super-hydrophobic and super-oleophylic melamine foam and a preparation method and application thereof. The super-hydrophobic and super-oleophylic melamine foam is prepared by the following steps of using porous melamine foam as a substrate; chemically grafting the substrate with a substance of one or a mixture of trimethoxysilylpropanethiol and 3-mercaptopropyltriethoxysilane to activate the substrate; under the existence of ultraviolet light and light initiator, enabling the thiol and the vinyl of long-chain alkane acrylic ester to generate clicking chemical reaction, so as to enrich C-C long chains on the substrate, so that the surface energy of the substrate is reduced, the roughness is improved, the hydrophobic property is greatly improved, and the oil and water selectivity is obviously improved. The preparation method has the advantages that the hydrophobic modification on the melamine foam is precise, the efficiency is high, the operation is simple and convenient, the implementing is easy, the consumption time is short, the cost is low, and the method is suitable for large-scale production. The super-hydrophobic and super-oleophylic melamine foam can be directly applied to the sea oil overflow, recycling of leaked chemicals, separation of oil and water mixture, and the like.