In 1797 France's Napoleon took Venice and by war's end the Dalmatian (Croatia's) Coast was under the control of the Hapsburgs, but the interior fell under the control of their ally, the Hungarians. The people of the interior fought the rule of Hungary and in the mid-1800s the people of both modern-day Croatia and Slovenia united for independence, but failed. This unity among the southern Slavs, also created ethnic pride and hence division among them based upon religion.
World War I began in Sarajevo (in modern day Bosnia & Herzegovina) with the assassination of the Austrian-Hungarian Archduke and by war's end the southern Slavs had created an independent country, with Yugoslavia being established in 1929. This union immediately proved destructive for the Croatians.
At the onset of World War II the Nazis placed a Croatian nationalist movement in power over Yugoslavia, creating mass murders of both Jews and Serbs within the region. After WWII, the Croatians rejected this government and again united with the other southern Slavs in Yugoslavia, which maintained almost complete independence from the communist government in the Soviet Union. This union upset the Croatians, who felt too much governmental money was being sent to Serbia, Montenegro, and Bosnia.