The topological properties and intrinsic anomalous Hall effect of CsCl-type ferromagnets GdZn and GdCd have been studied based on first-principles electronic structure calculations. According to the calculated band structures, both GdZn and GdCd host nodal lines near the Fermi level. Once the magnetization breaks the mirror symmetries, the nodal lines are gapped. This can create a huge Berry curvature. A large anomalous Hall effect is then generated when the Fermi level resides within the opened gaps of the nodal lines. Our works indicate that GdZn and GdCd can provide a promising platform for exploring the interplay between topological property and magnetism.