I make a report, and inside the report I have to send emails from different providers, these letters have their own css (usually built-in css, but sometimes they use common styles). I usually use iframes to encapsulate css so that it doesn't break mine, but I can't use it now.
Is there a way to encapsulate css without using iframes?
here is an example of the problem i have:
<html> <head> <style> // I enclose it to content so it doesn't override the email css #my_content table, #my_content p { color: black; } </style> </head> <body> <div id='my_content'> ... some stuff ... <div id='email'> <html> <head> <style> table { margin-left: 100cm; // screws up all my tables } .... some styles that should only apply inside the email div ... </style> </head> <body> .... email content ... </body> </html> </div> </div> </body> </html>
I could extract the html structure and just get what is on the body, but then not all my letters will look as they should. Also, the html must be valid, so any suggestions will be great!
Hassek
source share