views:

62

answers:

2

Is there a simple way to save an HTML page that has an external stylesheet (1 or more) referenced but force all of the rules to be inserted into the page itself, inline? So basically I want to move all external rules onto the elements that they affect themselves.

For what it's worth, I'm using nearly every major browser (incase the solution is browser-specific), and I'm on Windows (incase it's OS-specific).

+2  A: 

I use a tool that does something like that, but it was written for Ruby and TextMate for Mac. It is released by Campaign Monitor as a way of preparing HTML emails. It brings all the rules from the stylesheet and makes them inline styles.

It might give you a good start. I'll keep looking.

TextMate Email Bundle

The piece that does the heavy lifting is the TamTam RubyGem which brings the CSS inline. However, it seems to only support one style element (not link elements). If you could work with those restrictions, you could get it to work on Windows using Ruby and a ruby script file. Not quite drag and drop I'm afraid.

Doug Neiner
Unfortunately I'm not on a Mac, but for anybody who stumbles across this question who is, I'm sure this is a great solution.
Jonathan Sampson
+3  A: 

Hey Jonathan,

I'm assuming you've seen the online tools that are available like this one? This online tool (which I have not tested but looks like it works) gives you the option of providing a url or source code and shows warnings for cross-browser compatibilities with your styles.

jeerose
+1 Nice resource, and I love the fact that it's online.
Jonathan Sampson
+1 Awesome link @jeerose!
Doug Neiner