Q: I noticed that some graves have a cement cast on them that is one meter high and half a meter wide. The name of the deceased, the date of death, and some sentences are written on it, such as "O Allah! Have mercy upon (the name of the dead person)." What is the ruling on this?
A: It is impermissible to build anything on graves. It is also impermissible to write on them, according to what is authentically reported from the Prophet (peace be upon him) about the prohibition of building and writing on graves.
The Messenger of Allah (peace be upon him) forbade plastering of graves, sitting on them, and building over them.
May Allah curse the Jews and the Christians; they turned the graves of their prophets into places of `Ibadah (worship).
Allah has took me a friend as He has taken Ibrahim (peace be upon him) as a friend. If I were to take a friend from my Ummah (nation), it would have been Abu Bakr. Those before you used to turn the graves of their prophets and righteous people into places of `Ibadah. Do not turn the graves into Masjids; I forbid you to do this.