Design and fabrication of tunable dielectric metasurfaces for visible and infrared wavelengths