# Conservation of mass in fluid flow

When deriving the continuity equation in physics class for two immiscible fluids flowing in succession we used the principle of conservation of mass. My question is, shouldn't volume be conserved instead of the mass?

To further elaborate, assume section 1 of a pipe has cross-section area $A_1$ and section 2 has area $A_2$. At the point where liquid 1 with density $r_1$ is completely in section 2 and liquid 2 with density $r_2$ is just about to enter section 2. Shouldn't the volume of liquid in section 2 be conserved, i.e., $V_\mathrm{in}$ = $V_\mathrm{out}$ instead of the mass?

(Assume ideal fluids and ideal flow)