Nanostructured metasurfaces offer unique capabilities for subwavelength control of optical waves. Based on this potential, a large number of metasurfaces have been proposed recently as alternatives to standard optical elements. In most cases, however, these elements suffer from large chromatic aberrations, thus limiting their usefulness for multiwavelength or broadband applications. Here, in order to alleviate the chromatic aberrations of individual diffractive elements, we introduce dense vertical stacking of independent metasurfaces, where each layer is made from a different material, and is optimally designed for a different spectral band. Using this approach, we demonstrate a triply red, green and blue achromatic metalens in the visible range. We further demonstrate functional beam shaping by a self-aligned integrated element for stimulated emission depletion microscopy and a lens that provides anomalous dispersive focusing. These demonstrations lead the way to the realization of ultra-thin superachromatic optical elements showing multiple functionalities-all in a single nanostructured ultra-thin element.