Islam certainly teaches us to be compassionate to all Allah’s creation. The Prophet (peace and blessings be upon him) said, “Show mercy towards those on earth; the One in heaven will certainly show mercy towards you.”
Muslims should have good relations with all people; both males and females; at school, at work, in your neighbourhood, and so on. You should be kind and courteous to everyone. However, it is not allowed in Islam to take persons of the opposite gender as a very close friend. All interactions between members of the opposite sex must be governed by Islamic ethics of interaction.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: In Islam there are various categories and levels of relationships; first and foremost is the relationship of blood. It has degrees and levels: the highest degree of relationship is the one we owe towards our own parents through whom you came into this world; their rights come second only to the right of Allah; after which comes your own blood brothers and sisters. Blood relations can be divided into two broad categories: usul and furu` (roots and branches); roots are your parents and grandparents; while branches are your children and grandchildren, and so on.

Another division is the relations from your mother’s side and the relations from your father’s side. The closest are referred to as your maternal and paternal aunts and uncles.
Outside the close blood circle, there are marriage relations: for example, your in-laws such as your spouse’s parents, brothers and sisters.
The brotherhood of humanity is not the same as blood relationships. Its rules are different from the rules of blood relationship. You should never confuse the two. The prophet taught us that our charity should begin with the closest relations; the circle; however, should be extended gradually to include all humanity in the wider family.
Even though there is a clear distinction to be made between blood relations and others, that does not mean that we must not be compassionate to them: Islam certainly teaches us to be compassionate to all Allah’s creation. The Prophet (peace and blessings be upon him) said, “Show mercy towards those on earth; the One in heaven will certainly show mercy towards you.”
When it comes to our duties to our brothers and sisters in humanity, our general duties towards them can be summed up as follows:
1. To refrain from inflicting any harm or injury on anyone.
2. To wish everyone well and to treat everyone as you would love them to treat you.
3. To extend acts of general kindness towards everyone according to the best of your ability.
Having said this, I must add that as far as relations between members of the opposite sex are concerned, all interactions between them must be governed by Islamic ethics of interaction; these include the following:
1. We are not supposed to isolate ourselves with members of the opposite sex who are not closely related to us through blood or marriage.
2. We are not allowed to appear in front of them except in the prescribed attire;
3. We are not to flirt with them or stare at them or entertain lustful thoughts regarding them.
May Allah help us all to remain steadfast on the path of rectitude and right guidance-Ameen.