While most people seem to assume that the capital of Croatia is Dubrovnik it in fact isn’t. The capital of Croatia is Zagreb. It may not be as famous or beautiful but it is by a margin the biggest city in Croatia. If you include the metropolitan area Zagreb has around 1 Million inhabitants.
Zagreb has always been the capital of Croatia even if it was part of Yugoslavia. During the Communist regime Zagreb was the capital of the constituent republic Croatia with Belgrade being the capital of the entirety of Yugoslavia.
When in 1991 Croatia declared its independence from the central republic, Zagreb became the capital of the new Republic of Croatia. Since July 2013 Croatia became a EU member.