I just wanted to know if it's haram for parents to hit their children because my parents always slap me if I do something wrong
It depends. Hitting anyone without a proper cause is not permissible, rather it is oppression.
But hitting is permissible when it is done for the purpose of تأديب i.e. educating and training the child regarding his obligations and prohibitions. Beating would hence be a lesser harm which could prevent the child from facing much more serious consequences in this life and the next.
This has the following guidelines:
- other gentler methods (such as advising, scolding and warning) should have been tried beforehand and deemed ineffective
- the parent's best judgement should be that beating will be effective in correcting the child's behavior
- the beating must not target the face, as hitting the face is forbidden
- it must be a light beating which does not cause injury, nor severe pain
It is recorded in ahaith that it is permissible to strike one's child on refusal to observe Salah (Abi Dawud 495) and by analogy the same extends to other matters in which a parent needs to educate their children. The permission of striking for nashooz (Quran 4:34, Ibn Majah 1851) and the permission for striking in ta'zir (Bukhari 6852,Bukhari 6848) also extends to children by analogy since parents are guardians over them. And the hadith about Abu Bakr disciplining his daughter in the presence of the Prophet (Bukhari 6844, sharah) is also cited as evidence by scholars.
Hitting children in a moderate way as a means of disciplining children is not forbidden in Islam but rather discouraged than encouraged.
I found a good contribution on this topic here.
However, children should follow their parents also if they are not punished.
According to the hadith and this topic
Prophet, sallallaahu `alayhi wa sallam ( may Allah exalt his mention ), said: “Order your children to perform prayer when they are seven years old and beat them (for neglecting it) when they are ten.”[Al-Albaani: Hasan]
In my opinion, anything beside that is considered as child abuse and will only leave a negative impact on the child's health and this should be avoided at all cost, there are always other ways to settle things up.