I'm fairly new to Confluence, but I've found a number of topics on the same subject. Unfortunately none of them appear to have the solution for the problem.
I have a page setup with 2 tabs, on the left is actual content and on the right is just a TOC with CSS, Div and HTML comment.
I'm actually not even certain the HTML is having any affect here, but it still functions in the preview just fine, so I've left it alone.

I've reviewed a number of articles including this one that seems to be having the same issue as the well as the one they point to inside of that article. Perhaps I'm missing the obvious but any help is appreciated.
https://community.atlassian.com/t5/Confluence-questions/DIV-with-Custom-Style-Doesn-t-work-on-the-Page-but-works-in/qaq-p/634747