The liver is located in the abdominal cavity.
Understanding the Abdominal Cavity
The abdominal cavity is a major body cavity in humans and many animals. It houses a large number of vital organs. As stated in the provided reference:
The abdominal cavity contains the greater part of the digestive tract, the liver and pancreas, the spleen, the kidneys, and the adrenal glands located above the kidneys.
Therefore, the liver is one of the major organs contained within the abdominal cavity. Other organs within the cavity work in conjunction with the liver to perform various bodily functions.