I have a simple message forum which allows users to post HTML-encoded messages. Currently, I am not filtering the HTML tags they can use, so it is possible for someone to create their own DIV and mess up my page styling. Most users will simply use the Javascript "rich text editor", but I'd like to protect my style sheet anyway.
Is there some way to isolate a CSS DIV so it can't affect the rest of the page, or do I just need to resort to filtering the tags using PHP?
The HTML currently looks like this:
<div class="msg_content">
<p class="subject"><?php echo subject; ?></p>
<?php echo message; ?>
</div>
Also, I'd like the message portion not to inherit some of the CSS of the parent class. Is there a way to prevent all inheritance for a particular DIV, or do I have to set "inherit: none" for each HTML tag?