473,625 Members | 3,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wnat to embed full HTML page in email, but migrating style from css files to element style attributes

My web pages of course use css files, but Webmail services require
style to be in element style attributes.

How do I convert a standard HTML page to HTML suitable for delivery to
webmail services?

Perhaps another way to ask the question is:

How to I walk the DOM and for every element, for every style, set the
element's style attribute to the values that are looked up in the css
file in normal rendering.

Anyone know of any tools, or examples to do this?

Thanks,

- Henrik

Dec 14 '06 #1
3 1846
Rik
Henrik wrote:
My web pages of course use css files, but Webmail services require
style to be in element style attributes.

How do I convert a standard HTML page to HTML suitable for delivery to
webmail services?

Perhaps another way to ask the question is:

How to I walk the DOM and for every element, for every style, set the
element's style attribute to the values that are looked up in the css
file in normal rendering.

Anyone know of any tools, or examples to do this?
I'm not aware of any tools you describe, but undoubtly they're out there in
varying degrees.
Normally though, including the css sheet like <style type="text/css"><?php
include 'style.css'; ?></stylein the <headis enough, and it will keep
your (evil html...:P) emails somewhat shorter.
--
Rik Wasmus
Dec 14 '06 #2
Rik wrote:
Henrik wrote:
>My web pages of course use css files, but Webmail services require
style to be in element style attributes.

How do I convert a standard HTML page to HTML suitable for delivery to
webmail services?

Perhaps another way to ask the question is:

How to I walk the DOM and for every element, for every style, set the
element's style attribute to the values that are looked up in the css
file in normal rendering.

Anyone know of any tools, or examples to do this?

I'm not aware of any tools you describe, but undoubtly they're out there in
varying degrees.
Normally though, including the css sheet like <style type="text/css"><?php
include 'style.css'; ?></stylein the <headis enough, and it will keep
your (evil html...:P) emails somewhat shorter.
There was recently an article on webreference that said that only
inline styles are reliable in html mail:
<http://www.webreferenc e.com/programming/css_html/>

bill
Dec 14 '06 #3
Can you "inject" the contents of the css files in a style tag in the
html-head section of the mail? Like:

<html>
<head>
<style type="text/css"><!--
(contents of your css files here)
--></style>
etc.

Henrik wrote:
My web pages of course use css files, but Webmail services require
style to be in element style attributes.

How do I convert a standard HTML page to HTML suitable for delivery to
webmail services?

Perhaps another way to ask the question is:

How to I walk the DOM and for every element, for every style, set the
element's style attribute to the values that are looked up in the css
file in normal rendering.

Anyone know of any tools, or examples to do this?

Thanks,

- Henrik
Dec 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3778
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? If not, is there an easy way to strip the html tags from the <definition> content before inserting the content into the meta tag?
2
5421
by: François de Dardel | last post by:
Please don't scream that EMBED is evil ! What I am doing is <EMBED SRC="BWV659.mid" AUTOSTART="false" LOOP="TRUE" CONTROLS="SMALLCONSOLE" WIDTH="50" HEIGHT="15" TITLE="BWV 659"> Note the AUTOSTART="false"... In the good old days of Netscape 3 or so, just <A HREF="BWV659.mid">Musique</A> would open a small console in the active page itself, based on the plug-in selected by the user. Today, it opens
7
2329
by: Sky | last post by:
What I have currently: I have a user control called mod_container.aspx that is basically two divs -- the top a toolbar, that expands/collapse the second div which can contain other modules/controls (eg a newsfeed, quick phonelist, login, etc.) But the controls end up too 'deep': it appears that it would be lighter/better if I could just enherit the uc_login.aspx directly off of the uc_container.aspx so that all modules have the same...
2
1798
by: Eric Lindsay | last post by:
Most of the web pages whose source I look at have a very elaborate structure (even apart from any massive use of Javascript), often with div in div in div layered up to six deep, lots of classes and spans all over. I usually can't follow exactly why they are so elaborate (I know some are containers to avoid browser bugs). In addition to attempting to retrofit a more semantic structure on pages, I have been trying to reduce the...
5
5202
by: girishmat | last post by:
how to embed or open microsoft word file in a page using php script
24
6251
by: Manuel | last post by:
Is it possible to embed an image, like a company logo in a CDOSYS generated message? If yes, I´ll apreciate some code sample. I´ve been able to format messages in html the way I like, but I can't figure out how to embed an image. Thanks for your time. -- Manuel
3
4787
by: abrtlt | last post by:
I would like to have a web page in which, when the user clicks on any of several specific elements, a specific audio file is played, without reloading the page. The specific audio file name is obtained from a PHP script (accessing a MySQL database) that could be called using XMLHttpRequest and JavaScript would write in a "div" tag an "embed and play" HTML tag containing the audio file name. I am not sure this would work, as the embed tag...
7
6308
by: David Trimboli | last post by:
Suppose I've got HTML with the following in it: <ul class="navigation"> <li><a href="chapter1.html" title="Chapter 1">Previous</a></li> <li><a href="./">Contents</a></li> <li><a href="chapter3.html" title="Chapter 3">Next</a></li> </ul> I'd like to style this such that all three links appear on the same line, with Prev at the far left, Contents in the center, and Next at the
2
8066
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I did not understand some parameters totally in the HTML tag. These days when I was surfing the Internet I have found some comprehensive introduction to these two tags. I read it and conclude it with my own words; I think it will be useful to us, so I...
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7184
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.