The improved advancing front method is proposed for quadrilateral grid automatic generation and used in multi-media and complex domain. Background grid does not need to be given first, multi-media complex domain is divided into several closed sub-domains, information of points and lines from these closed sub-domain boundary is automatically extracted from the AutoCAD model, the generation of internal node is controlled with mesh density parameters and topology relation of points and lines from the closed domain. Grid density is controlled by the global density parameter and the relative size of adjacent sub-domains. Mesh quality evaluation system and multiple refinement measures are used to improve grid quality. First, the whole domain is divided into triangle meshes, after optimizing these triangle meshes, quadrilateral elements are obtained by combining or dividing these triangle elements, good quadrilateral meshes are obtained by these optimization measures. Finally, a railway embankment example shows its feasibility and reliability.