In spite of + gerund
Incorrect . In spite of work hard, he failed the exam.
Correct . In spite of working hard, he failed the exam.
Note: A preposition may be a single word or a group of words.
Watch video to know: Shipwreck more tragic than Titanic https://youtu.be/7IVaHgxHU20