Injury or surgery involving the leg, ankle, or foot can also cause swelling. Swelling may also occur after pelvic surgery, especially for cancer. Long airplane flights or car rides, as well as standing for long periods of time, often lead to some swelling in the feet and ankles.