The topic of Islam and children includes the rights of children in Islam, the duties of children towards their parents, and the rights of parents over their children, both biological and foster children. Also discussed are some of the differences regarding rights with respect to different schools of thought.
Muhammad established laws and examples (sunnah) in respect of which is obligatory for the Muslim community to follow.
Muhammad had seven children, three boys and four girls. All of his sons, including Ibrahim ibn Muhammad, died in infancy. Because of this, his experience as a father is sometimes described as "sorrowful". Muhammad also had an adopted son, Zayd, who is said to be the object of Muhammad's parental affection. He also had two grandsons, Hassan and Hussein, and three granddaughters, Umm Kulthum, Zaynab, and Umamah. In one Islamic tradition, Muhammad ran after Hussein in a game until he caught him. Muhammad used to let Umamah sit on his shoulders while he was praying. When someone expressed astonishment at the Prophet when the Prophet kissed his grandchild, he responded, "what can I do if God has deprived your heart of all human feeling?"
Muhammad has been described as being very fond of children in general. Watt attributes this to Muhammad's yearning for children, as most of his own children died before him. He comforted a child whose pet nightingale had died. Muhammad played many games with children, joked with them and befriended them. Muhammad also showed love to children of other religions. Once he visited his Jewish neighbor's son when the child was sick.
Once, Muhammad was sitting with a child in his lap, and the child urinated over Muhammad. Embarrassed, the father scolded the child. Muhammad restrained the father and advised him: "This is not a big issue. My clothes can be washed. But be careful with how you treat the child. What can restore his self-esteem after you have dealt with him in public like this?"
Imam Ahmad bin Hanbal said that preferential treatment of a child is permitted if he or she is handicapped while others are not. (In Al-Mughni, vol. 5, p. 605, it is stated that special treatment of a child is permissible due to a need, a handicap, blindness, his or her being from a large family, being engaged in studies, or something of the sort, as it is also permitted to withhold from a child who would spend what he is given on sinful or wicked things.)
A Hadith says, “It is better for parents to leave their children well provided (financially) than to leave them in poverty”.
Parents demonstrating an unearned preference for one child over the other is considered an act of injustice, as it could lead to an atmosphere of hatred, anger and dismay amongst the children in a household. But if a parent granted one of his children financial help to fulfill a necessity, such as a medical treatment coverage, then such a grant would not be categorized an act of injustice and unfairness. Such a gift will fall under the right to spend in the essential needs of the children, which is a requirement that a parent must fulfill. 
Muhammad said: "Every one of you is a protector and guardian and responsible for your wards and things under your care and a man is a guardian of his family members, and is accountable for those placed under his charge." (Bukhari and Muslim)
One of the rights that children have over their parents is to be provided with marriage when they are old enough without delaying it. Both the Quran and Muhammed order that young people and orphans be married when they are old enough.
Narrated Abu Huraira: A man came to Allah's Apostle and said, "O Allah's Apostle! Who is more entitled to be treated with the best companionship by me?" The Prophet said, "Your mother." The man said. "Who is next?" The Prophet said, "Your mother." The man further said, "Who is next?" The Prophet said, "Your mother." The man asked for the fourth time, "Who is next?" The Prophet said, "Your father. "
All Sunni/Shia schools of thought agree that forced marriages are strictly forbidden in Islam, as Islamic marriages are contracts between two consenting parties referred to as mithaq. A hadith attributed to Muhammad states that a woman cannot be given to a man in marriage without consulting her first, and her consent is obtained either by her agreeing to the marriage or by her remaining silent. 
In addition, Muhammad gave women the power to annul their marriages if it was found that they had been married against their consent.
"When a man gives his daughter in marriage and she dislikes it, the marriage shall be annulled." Once a virgin girl came to the Prophet and said that her father had married her to a man against her wishes. The Prophet gave her the right to repudiate the marriage.
In Islam, marriage is essentially a contract. However, the distinction between sacred and secular was never explicit in Islam, so it is not only a secular contract.
For a valid marriage, the following conditions must be satisfied, according to the major Islamic schools of jurisprudence:
The Maliki school of thought gives the right of ijbar to the guardian. Ijbar is defined as the annulment of marriage due to objection by male guardian. According to Malik ibn Anas, children due to their immaturity may choose an unsuitable partner for themselves, hence, the power of ijbar has been given to the guardian so that he may overrule the child to marry someone he thinks is unsuitable for her. This is the legal right given to the guardian for girls by Maliki school of thought. In addition, Islam requires that parents be followed in almost every circumstances, hence parents may ask their children to divorce a certain person, but this cannot be upheld in an Islamic court of law and is not a legal right of the parent.
No age limits have been fixed by Islam for marriage according to Reuben Levy, and "quite young children may be legally married". The girl may not live with the husband however until she is fit for marital sexual relations. The Hanafi madhhab of Islamic fiqh maintains that a wife must not be taken to her husband's house until she reaches the condition of fitness for sexual relations. Levy adds:
"In case of a dispute on the matter between the husband and the bride's wali (her nearest male kinsman and her guardian), the judge (qadi) is to be informed and he is to appoint two matrons to examine the girl and report on her physical preparedness for marriage. If they decide she is too young, she must return to her father's house until she is judged fit. Betrothal may take place at any age. Actual marriage is later, but the age for it varies in different lands."—Reuben Levy, The Social Structure of Islam
In Islamic legal terminology, Baligh refers to a person who has reached maturity, puberty or adulthood and has full responsibility under Islamic law. Legal theorists assign different ages and criteria for reaching this state for both males and females. In marriage baligh is related to the Arabic legal expression, hatta tutiqa'l-rijal, which means that the wedding may not take place until the girl is physically fit to engage in sexual intercourse. Some Hanafi scholars hold the opinion that sexual intercourse may take place before puberty, as long as it's not injurious to one's health. In comparison, baligh or balaghat concerns the reaching of sexual maturity which becomes manifest by the menses. The age related to these two concepts can, but need not necessarily, coincide. Only after a separate condition called rushd, or intellectual maturity to handle one's own property, is reached can a girl receive her bridewealth.
Islam highly recommends the "fostering" of children, defined as "assuming partial or complete responsibility of a child in lieu of the biological parents". However, Islam forbids naming the child as one's own or creating any "fictive relationships". Islamic adoption is sometimes called "fostering" or "partial adoption" and is similar to "open adoption". Traditionally Islam has viewed legal adoption as a source of potential problems, such as accidentally marrying one's sibling or when distributing inheritance.
If a child is adopted he or she does not become a son or daughter, but rather a ward of the adopting caretaker(s). The child's family name is not changed to that of the adopting parent(s) and his or her guardians are publicly known as such. Legally, this is close to other nations' systems for foster care. Other common rules governing adoption in Islamic culture address inheritance, marriage regulations, and the fact that adoptive parents are considered trustees of another individual's child rather than the child's new parents. Usually an adopted child inherits from his or her biological parents, not automatically from the adoptive parents. If the child is below the age of consent at the time of inheritance (from the biological family), his or her adoptive parents serve as trustees over the child's wealth, but may not intermingle with it.
Adoption was a common practice in pre-Islamic Arabia. According to this custom, the adopted son would take the name of his adoptive parent, and would be assimilated into the family in a "legal sense". Islam viewed this practice as "erasure of natal identity". This practice was sometimes done for emotional reasons, such as pity, but adoption was also a means through which slaves were stripped of their identities and given the name of their slavemaster. The Quran replaced the pre-Islamic custom of adoption by the recommendation that "believers treat children of unknown origin as their brothers in the faith".
From verses 4 and 5 in sura 33 (Al-Ahzab) in the Quran, Allah instructed adoptive parents to refer to their adoptive children by the names of their biological parents, if known:
...nor has He made your adopted sons your sons. Such is (only) your (manner of) speech by your mouths. But Allah tells (you) the Truth, and He shows the (right) Way. Call them by (the names of) their fathers: that is juster in the sight of Allah. But if ye know not their father's (names, call them) your Brothers in faith, or your maulas. But there is no blame on you if ye make a mistake therein: (what counts is) the intention of your hearts: and Allah is Oft-Returning, Most Merciful.—Quran