Zar‘ah bin ‘Abdur Rahman narrated from his father ‘Abdur Rahman (bin Jarhad, may Allah be pleased with him), who was among the Companions of the Suffah. He said: The Messenger of Allah (peace and blessings be upon him) sat with us and my thigh was uncovered. The Prophet (peace and blessings be upon him) said: “Cover it, do you not know that the thigh is ‘awrah (i.e., something that must be covered)?”
Brief Explanation
(Commentary on Hadith 2685)
It is narrated from Imam Awza'i rahimahullah that in the mosque, the thigh is 'awrah (part of the body that must be covered), but not in the bathhouse (hammam).
The opinion of most scholars and mujtahids is also that the thigh is 'awrah and it should be covered. From this, it is understood that wearing shorts or knickers is not permissible because the thigh remains exposed, and even the private parts may become uncovered. As for a girl, her entire body from head to toe is 'awrah; therefore, it is absolutely haram for Muslim girls to wear frocks, knickers, skirts, etc., in school.
«فاعتبروا يا أولي الأبصار».