According to the legend, Dannebrog fell down from the sky on June 15, 1219 to the Danish King Valdemar II during his crusade to Estonia. With the flag in hand, the King won the battle at Lyndanise near Reval (Tallinn). The flag was given to him as a divine approval. This is the explanation Danes like to give in order to tell the origin of the Danish national flag. The word “Dannebrog” literally means the cloth of the Danes.
And some technical details: the proportions of the cross should be horizontally from hoist to the tail 12/4/21, and vertically 12/4/12. The proportions of the flag with a swallow-tail are 24 : 8 : 30 : 45 horizontally and 24 : 4 : 24 vertically. The proportions of the “Dannebrog” are so because Danish flag law prescribes the relative widths of each block of color, including the fimbriations, and when you add all the pieces together you get those numbers.
Read more about Dannebrog – the Dannish Flag