[SalesForce] Visualforce rich text input area spacing

I have a rich text textarea on my vf page that I am populating with the html from an email template. Everything appears correct except the paragraph spacing is double spaced. Does anyone know how to control the vertical spacing? Is it a style element?

Best Answer

There are some inconsistencies between the rich text control and the email template html version. The template editor puts a style in the beginning to limit the

tag spacing.

<style>p{margin-top:0px; margin-bottom:0px;}</style>

I could not simply prefix the body html with the style as the rte control stripped it out. I put code in the controller for all p tag styles to include these entries. Fortunately they were all one of two standard formats.

There also appeared to be unprintable characters that caused an extra

tag in a couple places. Deleting all white space and replacing with only the required spaces and returns seems to resolve that as well.

Related Topic