I don’t understand your question.
The snippet will hide the tags in preview mode, not in edit mode (which makes sense, as you would still want to see your source code somewhere…).
If it doesn’t hide your tags even in preview mode, it might possibly conflict with some other css…
- Which theme and/or custom css are you using?
- Can you paste the snippet you saved as custom css?