Milk of magnesia is chemically known as magnesium hydroxide. Although this compound isn't very water soluble, the small amount that does dissolve acts as a base. Thus, milk of magnesia is somewhat basic, and litmus paper would turn blue if exposed to it.