The liver is attached to the anterior abdominal wall and diaphragm primarily by the falciform ligament, a fold of peritoneum. Additionally, the coronary ligament, which is a part of the peritoneal reflection, helps secure the liver to the diaphragm. These structures provide support and help maintain the liver's position within the abdominal cavity.