Praise be to Allah.
Islam forbids erecting structures over graves, and commands that any such structures should be knocked down. But it is permitted to put a marker on the grave so that the family and friends of the deceased will know where it is. However, this marker should not be a structure or anything else that is not allowed in sharee’ah.
1 – With regard to the prohibition on erecting structures over graves, the evidence for that is as follows.
It was narrated that Jaabir said: The Messenger of Allah (peace and blessings of Allah be upon him) forbade plastering over graves, sitting on them and erecting structures over them.
Narrated by Muslim, 970.
The phrase “erecting structures over them: indicates that it is haraam to build anything over a grave.
Al-Shaafa’i and his companions made the following distinction: if the structure is built on the property of the person who builds it, it is makrooh, and if it is in a public graveyard, it is haraam.
But there is no evidence for making this distinction.
Al-Shaafa’i said: I saw the imams in Makkah ordering that what had been built (over graves) was to be knocked down.
The hadith of ‘Ali also indicates that such structures should be destroyed.
Nayl al-Awtaar, 4/132; the view of al-Shaafa’i is mentioned in al-Umm, 1/277
The hadith of ‘Ali referred to will be quoted below.
With regard to the command to knock down structures that have been built over graves, that is proven in the Sunnah.
It was narrated that Abu’l-Hayaaj al-Asadi said: ‘Ali ibn Abi Taalib said to me: “Shall I not send you on the same mission as the Messenger of Allah (peace and blessings of Allah be upon him) sent me? Do not leave any statue without erasing it, and do not leave any raised grave without leveling it.” (Narrated by Muslim, 969).
The words “do not leave any raised grave without leveling it” means that the Sunnah is that a grave should not be made very high, and there should be no differentiation between those who were virtuous and those who were not virtuous.
It seems that making a grave higher than the amount that is permitted is haraam. This was clearly stated by the companions of Ahmad and a group of the companions of al-Shaafa’i and Maalik.
The view that it is not haraam because the earlier and later generations did that without anyone denouncing that action, as Imam Yahya and al-Mahdi said in al-Ghayth, is not correct, because the most that can be said is that they kept quiet about it, and keeping quiet does not count as evidence if it has to do with matters which are not definitive, and the prohibition of making graves high is not definitive.
The making graves high that is mentioned in the hadith especially includes the domes and shrines that are built over graves, and the taking of graves as places of worship. The Prophet (peace and blessings of Allah be upon him) cursed those who do that. (Nayl al-Awtaar, 4/130).
With regard to it being permissible to mark a grave with something permissible, there is evidence in the Sunnah which explains that.
It was narrated from Katheer ibn Zayd al-Madani that al-Muttalib said: When ‘Uthmaan ibn Maz’oon died, his bier was brought out and he was buried, then the Prophet (peace and blessings of Allah be upon him) ordered a man to bring a rock but he was not able to carry it. So the Messenger of Allah (peace and blessings of Allah be upon him) stood up and rolled up his sleeves. Katheer said: al-Muttalib said: the one who narrated that to me from the Messenger of Allah (peace and blessings of Allah be upon him) said: it is as if I can see the whiteness of the arms of the Messenger of Allah (peace and blessings of Allah be upon him) when he rolled up his sleeves. Then he carried it and placed it at the head (of the grave), and said, “From this I will recognize the grave of my brother, and I can bury those among my family who die near him.” (Narrated by Abu Dawood, 3206)
The isnaad of this hadith was classed as hasan by al-Haafiz ibn Hajar in al-Talkhees al-Habeer, 2/133).
Ibn Qudaamah said:
There is nothing wrong with marking a grave with a stone of a piece of wood. There is nothing wrong with a man marking a grave so that he will know where it is. The Prophet (peace and blessings of Allah be upon him) marked the grave of ‘Uthmaan ibn Maz’oon. Al-Mughni, 2/191.
And Allah knows best.