tags:

views:

22

answers:

1

Hi,

I'm looking for a tool which uses the CSS selectors within a stylesheet to generate the selected inline style.

E.g :

<head>
<style text="text/css">
a {
   text-decoration: none;
}

#a, #b, #c
{
   position: absolute;
}

#b
{
   left: 50px;
}
</style>
</head>
<body>
  <div id="a">
    <p>
     <a href="http://www.stackoverflow.com"&gt;SO&lt;/a&gt;
    </p>
  </div>
  <div id="b">
  </div>
  <div id="c">
  </div>
</body>

will be :

<body>
  <div id="a" style="position: absolute">
    <p>
     <a href="http://www.stackoverflow.com" style="text-decoration: none;">SO</a>
    </p>
  </div>
  <div id="b" style="position: absolute; left: 50px;">
  </div>
  <div id="c" style="position: absolute">
  </div>
</body>

Any ideas ?!

EDIT :

I want to do that to be able to 'style' email in most email client, especially for gmail, which doesn't support external or even internal stylesheet.

+1  A: 

Hi,

you can do it with the following online application:

Convert CSS to inline styles

ArneRie
Wow, what's the benfit in this?
UpTheCreek
mostly used for email send through gmail, they dont support css in headers.. ;)
ArneRie
Yeah but then wouldn't you develop styles especially for email sending? But ok I get that this could be helpful for newsletter and so on
marcgg
it's usefull, when you develop newsletter like a classic html page, with firebug, and so on. Inline styling from hand it's just painfull and messy.
Boris Guéry