For the purpose of promoting health, safety, morals, or the general welfare of the community, the city or town council or other legislative body of cities and incorporated towns is hereby empowered to regulate and restrict the height, number of stories, and size of buildings and other structures; the percentage of lot that may be occupied; the size of yards, courts, and other open spaces; the density of population; and the location and use of buildings, structures, and land for trade, industry, residence, or other purposes.
§ 76-2-301, MCA