In the past elementary school students used to wear black smock, to protect their clothes from the the ink (at the time of ink and inkwell).
With the introduction of ballpoint pens, girls started to use a white smock and boys a black one. When I went to elementary school we also used to wear a ribbon: pink for girls, blue for boys.
One might consider this tradition a little bit sexist. But the purpose of the smock was actually equality: no differences based on wealth and expensive clothes, any student looked exactly like the other in schools.
In any case nowadays they used just one color for both boys and girls. Much more politically correct.