In the early 1800s the French, under Napoleon took the lands of Slovenia and this brief transfer of power and the ideas the French introduced created a national identity and a growing independence movement.
World War I created independence movements throughout the Balkan Peninsula and was in fact started with the murder of Austria's Archduke by a Serb nationalist in Sarajevo. After the war, the Slovenes, Croats, and Serbs united to form their own country, which later incorporated Montenegro, Bosnia, and what is today Macedonia, at which time it was renamed Yugoslavia.
Immediately after this union, Slovenia became one of the most economically and industrially prosperous countries within Yugoslavia. However, this progress was interrupted by World War II (WWII) in 1941 when the region was overrun by Fascist Italy and Nazi Germany. Eventually the region was liberated and Yugoslavia again emerged as a communist country.
After WWII, Slovenia again surged ahead of the rest of Yugoslavia and again independence movements arose. In 1991 Slovenia finally declared independence, but was immediately attacked by the Yugoslavian Serb-led army, but after a brief war the two sides stopped fighting and Yugoslavia essentially granted Slovenia independence.