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.