It should be clear that Islam does not sanction any discrimination between children based on gender differences; this is totally un-Islamic. The idea that a baby boy should be nursed for a longer period than a baby girl can be traced to customs of people, while Islam is totally innocent of such discrimination.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: “Allah says in the Qur’an: “And the mothers may nurse their children for two whole years, if they wish to complete the period of nursing…And if both (parents) decide, by mutual consent and counsel, upon weaning the child, they will incur no sin (thereby); and if you decide to entrust your children to foster-mothers, you will incur no sin provided you ensure, in a fair manner, the safety of the child which you are handing over. But remain conscious of Allah, and know that Allah sees all that you do.” (Al-Baqarah: 233)
Based on the above verses as well as the relevant traditions of the Prophet (peace and blessings be upon him), scholars have concluded that the ideal period of breast-feeding a child is two years. In this respect there is absolutely no difference whatsoever between a baby boy and a baby girl. One should, however, not rush to conclude from this that parents are not allowed to wean a child before two years.
Parents are allowed to wean a child before the expiry of two years —provided they do so based on consensual agreement and provided doing so would not jeopardize the health of the child. Children vary in their need for breast milk because of the differences in their development and health considerations. This is why the Shari`ah has not laid down any hard and fast rule in this regard. The decision when to wean a child is left to parents, who are instructed to exercise it by considering primarily the welfare of the child involved.
If, therefore, it has been determined that weaning a particular child before two years is considered detrimental to the normal health of the child, it shall be considered haram (unlawful) for parents to do so, as we are not allowed to jeopardize the wellbeing of a child.
It should be clear from what is stated above that there is no difference in all of these between a baby boy and baby girl. The Qur’anic imperative stipulates that each child must be fed according to his or her needs and health conditions. To discriminate between children based purely on gender differences is not sanctioned in Islam. We must, therefore, consider it as purely un-Islamic. If one asks: Where did such an idea come from? The answer: It can be traced to customs of people, which ironically they often tend to project onto Islam, while Islam is totally innocent of such discrimination. Allah says, “Allah speaks the truth and He guides to the straight way.” (Al-Ahzab: 4)”