I'm aware that since the 1840s-50s, Liberalism has also changed substantially, but Nationalism, at that time, seems to have been strongly associated with classical liberalism. Now it seems to be a mostly conservative ideology. Does Romanticism have anything to do with it?
I think the main reason is that in the period from the late 18th century to the mid 19th century, traditionally dated as when nationalism became important as the basis of political legitimacy in the Western world, nationalist movements arose in opposition to established conservative power (i.e. monarchs, the aristocracy and the church); groups which favoured the dynastic and religious forms of political legitimacy that had been dominant in Europe for centuries. However as the 19th century progressed, nationalism was adopted by this established conservative power, and / or the new social groups that came to power in the revolutions of the 18th and 19th centuries turned into established conservative power themselves.
(This is not to say that prior to the age of nationalism established conservative power did not identify itself with the nation and seek to bind the nation's loyalty to it, only that when modern nationalist political movements first arose, they arose in opposition to it.)
For example, if we think of France, the nationalist rhetoric of the revolution is aimed squarely at conservative power. Article 3 of the Declaration of the Rights of Man and of the Citizen 1789 reads "The principle of all sovereignty resides essentially in the nation. No body nor individual may exercise any authority which does not proceed directly from the nation". Or as Sieyes writes in 'What is the Third Estate' (1789) "Who is bold enough to maintain that the Third Estate does not contain within itself everything needful to constitute a complete nation? It is like a strong and robust man with one arm still in chains. If the privileged order were removed, the nation would not be something less but something more." And as Robespierre declared in 1792 "Louis must die because the patrie must live" (Bell 2001:1). So as you can see, the whole concept of the nation depends on opposition to the monarchy and aristocracy, and this is its principal focus, rather than competition between nation-states as for example in WW1.
Similarly in Germany, once the Napoleonic wars were over, the principal enemies of the nationalists were the German monarchies (principally Austria and Prussia) and ruling aristocracies, who opposed and repressed the liberal German-nationalist 1848 attempted revolutions and reforms. Just as in France half a century before, nationalism was a threat to conservative power, not a way of bolstering it as it is often seen today (but not always, e.g. Catalonia, Scotland, Kurds). However as the 19th and 20th centuries progressed, you saw established political power harnessing nationalism. The best example of this is Germany, where the Prussian monarchy and state adopted the pan-Germanism of the liberal nationalists, but not the liberalism. In Britain you can see the transformation of the royal family from dynastic rulers of foreign origin into symbols of the nation (e.g. the name-change from Saxe-Coburg-Gotha to Windsor in 1917). In France Napoleon I and III adopted aspects of liberalism while repressing its more radical forms, and the descendants of the revolutionaries of 1789 became the new establishment.
Bell, David (2001). The Cult of the Nation in France. HUP
Hobsbawm, E. (1996 [1962]) The Age of Revolution 1789-1848. Vintage Books
Hobsbawm, E. (1992). Nations and Nationalism since 1780 - Programme, Myth, Reality. Cambridge University Press