Yes, this is a common requirement. You need to sanitize the HTML and CSS that you receive from users to ensure it doesn't contain any JavaScript or anything that will surreptitiously load JavaScript. This is non-trivial, so there are tools for it: HTML sanitizers (and CSS sanitizers). These are proper, full-on HTML and CSS parsers that you give whitelists to to allow certain tags and attributes and to disallow other tags and attributes (and limit values of attributes).
The sanitizers need to run server-side, and ensure that the user-supplied content is sanitized before being displayed to any other user.1 So you'll need to find the right tool for your server-side environment, such as the HTML Agility Pack for .Net, OWASP Anti-Samy for Java, etc.
1 The natural instinct is to sanitize it on receipt, but just sanitizing on receipt isn't good enough, because if you find a flaw in your rules, you have to re-sanitize everything you've stored, or sanitize on both receipt and delivery.