Each of these cavities is extensive in terms of surface area, but in terms of volume amounts to only a few ml. in a healthy person - only a film of fluid separates visceral and parietal layers of the serous membranes bounding these cavities.
Recall that the intra-embryonic coelom is a medially-directed cleft that splits the lateral mesoderm into two layers: somatic and splanchnic mesoderm. The intra-embryonic coelom extends forwards, around the front end of the neural plate to form a continuous U-shaped cleft from one side of the embryo to the other. (If you are small enough, you could walk in from one side of embryonic disc, through this curving tunnel, and out at the other side.) The anterior region of the U-shaped coelom is separated from the extra-embryonic coelom by a transverse bar of embryonic mesoderm which will later become the septum transversum. Remember that folding of the embryonic disc will bring this septum to a position caudal to the heart, where it will contribute to development of the liver and diaphragm. This anterior part of the intra-embryonic coelom will become the pericardial cavity, and the heart develops in close relationship with it.
By the time the heart has started to beat, the intra-embryonic coelom has two major compartments, partially separated from each other by the septum transversum: the pericardial cavity and the peritoneal cavity.
In the mid-embryonic period, the pericardial and peritoneal cavities still communicate with each other by way of two channels that exist behind (dorsal to) the septum transversum. These are the pericardio-peritoneal canals. Later, the lung buds grow down into these canals by passing behind the heart.
In addition, the peritoneal cavity is still in communication with the extra-embryonic coelom that extends along the umbilical cord. This latter communication playes a significant role during development of the midgut - remember the 'physiological herniation' of the midgut loop during weeks 6-12.
Intraembryonic coelom - note the septum transversum partially subdividing the thoracic cavity (above) from the abdominal cavity (below). The arrows indicate the pericardio-peritoneal canals.
further subdivision of the coelom
Final subdivision of the original coelom into pericardial, pleural, and peritoneal portions depends on two events: