Another possible cause is excess salt in the diet. Foods high in sodium can cause the body to retain water, leading to swelling in the ankles and legs by evening.
Pregnancy can also lead to swollen legs because the body naturally holds more fluid, and pressure on blood vessels increases as the baby grows. Mild swelling is often normal during pregnancy, but sudden or severe swelling should always be checked by a doctor.
Some medications may contribute as well. Blood pressure medications, steroids, hormones, and certain diabetes drugs can sometimes cause fluid retention.