ROCKFORD, Ill. (WTVO) — Cooling off in your backyard with an above-ground or in-ground pool can be one of the best ways to spend the summer.

However, it is important to remember the safety precautions of owning a pool before installing one.

In Illinois, swimming pools are considered an “attractive public nuisance” that attracts children to potential dangers. Children may not understand the dangers associated with swimming pools and may trespass into a swimming pool area.

According to the Centers for Disease Control and Prevention, drowning is the number one cause of unintentional injury or death in children ages 1 to 14.

All “new outdoor swimming pools on private residential property must be enclosed by a fence, wall, or other effective permanent barrier of 42 inches [3.5 feet] or greater height,” according to the Illinois Private Swimming Pool Enclosure Act.

Local ordinances can also regulate the enclosure of swimming pools.

In Rockford, for instance, a swimming pool is considered any structure that holds water over 24 inches deep and includes hot tubs and wading pools. A city ordinance requires a fence 48 inches [4 feet] high.

A fence around your property can also legally serve as a fence around the pool, as long as all gates are equipped with a self-closing and self-latching device that is inaccessible to small children.