A kind of diffractive optical elements (DOE) with star-ring topological structure is proposed and their focusing and imaging properties are studied in detail. The so-called star-ring topological structure denotes that a large number of pinholes distributed in many specific zone orbits. In two dimensional plane, this structure can be constructed by two constrains, one is a mapping function, which yields total potential zone orbits, corresponding to the optical path difference (OPD); the other is a switching sequence based on the given encoded seed elements and recursion relation to operate the valid zone orbits. The focusing and imaging properties of DOE with star-ring topological structure are only determined by the aperiodic sequence, and not relevant to the concrete geometry structure. In this way, we can not only complete the traditional symmetrical DOE, such as circular Dammam grating, Fresnel zone plates, photon sieves, and their derivatives, but also construct asymmetrical elements with anisotropic diffraction pattern. Similarly, free-form surface or three dimensional DOE with star-ring topological structure can be constructed by the same method proposed. In consequence of smaller size, lighter weight, more flexible design, these elements may allow for some new applications in micro and nanphotonics.