For the purpose of promoting health, safety, morals or the general welfare of the community, cities of the second class are hereby empowered to regulate, restrict or determine, the height, number of stories and size of buildings and other structures, the percentage of lot that may be built upon, the size of yards, courts and other open spaces, the density of population, and the location, use and occupancy of buildings, structures and land for trade, industry, residence or other purposes.
53 P.S. § 25051