For the purposes of this section:
"Fence" means a close type vertical barrier not less than four feet in height above ground surface. A woven steel wire, chain link, picket or solid board type fence or a fence of similar construction which will prevent the smallest of children from getting through shall be construed as within this definition.
"Swimming pool" includes any outdoor man-made structure constructed from material other than natural earth or soil designed or used to hold water for the purpose of providing a swimming or bathing place for any person or any such structure for the purpose of impounding water therein to a depth of more than two feet.
Any locality may adopt ordinances making it unlawful for any person to construct, maintain, use, possess or control any pool on any property in such locality, without having a fence completely around such swimming pool. Such ordinances also may provide that every gate in such fence shall be capable of being securely fastened at a height of not less than four feet above ground level; that it shall be unlawful for any such gate to be allowed to remain unfastened while the pool is not in use; and that such fence shall be constructed so as to come within two inches of the ground at the bottom and shall be at least five feet from the edge of the pool at any point.
Violation of any such ordinance may be made punishable by a fine of not more than $300 or confinement in jail for not more than thirty days, either or both. Each day's violation may be construed as a separate offense.
Any such ordinance may be made applicable to swimming pools constructed before, as well as those constructed after, the adoption thereof. No such ordinance shall take effect less than ninety days from the adoption thereof, nor shall any such ordinance apply to any swimming pool operated by or in conjunction with any hotel located on a government reservation.
Va. Code § 15.2-921