Fluid can build up in the body and other organs as a result of heart failure. This fluid buildup can cause swelling, particularly in the legs and ankles.