tags:

views:

45

answers:

1

I want to display email in a section of a page with other data (CSS layout). When the emails are sent to the browser (jQuery Ajax), one of the emails has a CSS style that affects the existing pages CSS. I rather not use an iframe to contain the emails.

How do providers such as Gmail and Yahoo display emails with HTML and CSS without the embedded CSS/HTML affecting the rest of the page?

+1  A: 

The e-mails are carefully parsed server-side and often reformatted. You'll notice that this isn't perfect. There are often all sorts of issues with HTML e-mail.

Brad
Yeah, there's huge amounts of rewriting going on. Gmail strips out all sorts of stuff like background images, for example, and it gives my e-mails an ID like ":3b" and class "ii gt" (presumably it's prefacing all CSS instructions for that e-mail with these).
ceejayoz