simon peter simon peter - 25 days ago 10
CSS Question

How to stop CSS within a RichText field from overwriting document

I have a

RichText
field in my document that displays the content of an incoming mail. I noticed whenever there is an HTML email, the CSS in the email overwrites the color of my links and Glyphicon in almost the entire document.

How can I prevent this from happening?

the RichText Field code:

<xp:inputRichText value="#{document.Body}" id="body1" htmlFilter="identity"> </xp:inputRichText>

Answer

You can use

  • a "sanitizer" to clean up RichText's HTML from styling or certain styling OR

  • own CSS classes for your elements.