Magma is classified as basaltic, andesitic, or rhyolitic based on what factor?

A. Amount of pressure placed on it during formation
B. Amount of silica it contains
C. Region of the Earth in which it formed
D. Temperature of the magma