For any or all of the purposes provided in § 301 of this title, the legislative body may divide the municipality into districts of such number, shape and area as may be deemed best suited to carry out the purposes of this chapter, and within such districts it may regulate and restrict the erection, construction, reconstruction, alteration, repair or use of buildings, structures or land. All such regulations shall be uniform for each class or kind of buildings throughout each district but the regulations in 1 district may differ from those in other districts.