Sending contents of a particular div on page with “Send page by e-mail” option of IE

雨燕双飞 提交于 2019-12-08 08:30:04

问题


I have a page with a div hidden that has some contents in it. I want to able to send only the contents of this hidden div and nothing else on the page with "send page by e-mail" option if IE. How can I do this? Is there any specific css support for this purpose like we have print media type for printing documents?


回答1:


"Send -> Page By Email" seems to copy over all page content into a new email window. The CSS doesn't seem to stick, but the table structures do (in an Outlook email at least). This might be because Outlook can't handle css layouts. I haven't done any HTML email lately (thank god) but from what I remember, you couldn't count on CSS for laying out HTML emails, especially for the MS-based email clients.

What this tells me is that this is NOT a 'version' of the page the way that the screen vs print versions of the page are rendered in the browser with applied CSS. When the email loads from that command, it grabs ALL content on the page, even stuff that's hidden via CSS by default. My feeling is that its grabbing the HTML and pasting it directly into the email, along with the embedded images.

Final conclusion: Standard media directives for CSS will be useless for this scenario.

Your best bet would be to prepare an alternate version of the page (with ONLY the desired elements present in the HTML source), which uses tables for rough page layout. Have the users click to this page, and THEN instruct them to use the "Send -> Page by Email" command.



来源:https://stackoverflow.com/questions/12406603/sending-contents-of-a-particular-div-on-page-with-send-page-by-e-mail-option-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!