Between 1814 and 1914 every country and social group in Europe embraced the idea of nationalism because it offered something to everyone of all social and political groups. Nationalism is not a specific idea for government but whatever is best for the nation. Nationalism combined well with other ideas of the time, romanticism and liberalism. Not all the social classes in Europe accepted nationalism at the same time or for the same reasons. Nationalism began with the middle class in 1814 through 1848.
Soon after the French revolution in 1814 the Congress of Vienna was charged with reconstructing Europe. The French monarchy was back and in 1830 King Louis Phillipe had created a system in which only the rich got a vote. In 1848 the middle class revolted and set up the Second Republic, giving all men a vote and unifying France in equality.
Germany was under the German Confederation, which was made up of 39 separate states. Many middle class businessmen wanted Germany to become whole as a nation-state because of the taxes and tariffs involved with transporting goods throughout the Confederation. But the German conservatives were opposed to liberalism and nationalism, and stood in the way of the middle class. In 1830 the middle class overpowered the conservatives and got their revolution. Soon they created the National Parliament and in 1848 the Frankfurt Assembly drew up plans for a unified nation-state. Their plans were thwarted however by Germany's kings who ordered their armies stop the revolution. Although the revolution was stopped it helped the spread of nationalism.
Between 1848 and 1871 the upper class began to accept Nationalism. In the years before 1848, conservatives felt nationalism was a threat to their power, but in the following years they accepted it into their own ideals. The revolts had shown them the danger of disregarding nationalism and it seemed simpler to compromise.