In all zone districts, fences or walls or combinations thereof enclosing or within front yards shall be permitted, provided the same shall not exceed four feet in height and further provided that such fences exceeding 2 1/2 feet in height shall not be more than 50% solid. Fences or walls or combinations thereof enclosing or within side and/or rear yards shall be permitted, provided the same shall not exceed six feet in height in residence zone districts or eight feet in height in all other zone districts; and, in either case, may be more than 50% solid. Height restrictions contained herein shall be measured from unmodified grade elevation and shall be applicable to retaining walls and to combinations of fences and retaining walls when viewed from either side thereof, except that, for safety purposes, no fence mounted on top of a retaining wall shall be required to be less than four feet in height.