Igneous Rock Types by Chemical Composition
Granite and basalt are at opposite ends of a chemical composition range defined by percentage of silicon. Rocks composed of over 65% silicon are called felsic, which is short for "has lots of feldspar" (feldspar is a type of mineral). Rocks with less than 50% silicon are called mafic, or "magnesium-ferric" (ferric means iron), and less than 45% silicon are ultramafic. Rocks between 50% and 65% are just called "intermediate."
The amount of sillicon plays a major role in determining which minerals the rock has. Mafic minerals have proportionally the least silicon, while felsic minerals have the most. Mafic and felsic are also at opposite ends of a range of melting/freezing temperatures. Mafic minerals have the highest melting/freezing points, while felsic minerals have the lowest. In a cooling body of magma, the most mafic minerals crystallize first and the most felsic ones last, in an order known as Bowen's reaction series.
Roughly in order from mafic to felsic, the most common minerals are: olivine, pyroxenes such as augite, calcium-rich feldspar (plagioclase), amphiboles such as hornblende, the mica biotite, sodium-rich feldspar (also plagioclase), potassium-rich feldspar (orthoclase), the mica muscovite, and quartz.
To summarize, the two types of igneous rocks by chemical composition are felsic and mafic. Granite - typically composed of orthoclase, hornblende, biotite, and quartz - is a felsic rock type. Basalt is mostly olivine, augite, and calcium-rich plagioclase, therefore mafic.