In this paper we report results obtained in the design and fabrication of diffractive optical elements (DOEs) with minimum feature size down to tens of nanometers by the use of e-beam and x-ray lithography. The DOEs are patterned using e-beam lithography and replicated by x-ray lithography. Since in our days there is an increased interest for extreme ultraviolet and x-ray microscopy our work has been focused toward the fabrication of DOEs mainly for these applications. Different types of zone plates (ZPs) were fabricated for x-ray beam focusing: high resolution ZPs for high resolution beam focusing, multilevel phase ZPs to increase the diffraction efficiency in the desired order and high aspect ratio ZPs for hard x-rays. Recently we have extended the concept of the ZPs to a more general category of DOEs which beside simple focusing can perform new optical functions in the range of x-rays. In particular, the intensity of the beam after the DOE can be distributed with almost complete freedom. We have designed and fabricated DOEs that focus the beam in an array of spots disposed either in plane or along the optical axis. This type of DOEs has been tested successfully in x-ray differential interference contrast microscopy. The possibility to introduce a specified phase shift between the generated spots is demonstrated in this paper by preliminary results obtained from computer simulations and experiments performed in visible light.