Since nationalists believed that their country was better that all others, they wanted to expand it. Imperialism is the practice of maintaining colonies to benefit the mother country.
Nationalists felt strong loyalty towards their country. They may have even believed that their leader had divine help to conquer all enemies. The people conquered by these nationalist colonists were often called "inferior" or "savages;" that way, leaders could justify taking their land and property.
By 1900, many major countries were competing with each other for colonies. The British Empire covered Canada, India, Australia, parts of Africa and even a small part of South America. The French had parts of Africa, along with Germany. Russia also held Poland, Estonia, Ukraine, Finland, Georgia and parts of Asia. Since the rulers of each country thought they deserved to rule the whole world, military spending increased. The countries also made military alliances with each other. The competition for colonies with some countries and alliances with others contributed to the start of World War I in 1914.
Russia's annexation of the Crimea is a more recent example of nationalism and imperialism. However, most countries today are not imperialistic. People still feel nationalism and pride in their country, but they want economic success instead of expansion.