This example is partially based on this Leaflet demo. CSS + Images of flags obtained from the World Flags Sprite project.
You can see a standalone example of this code here.