Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to transform a block style/CSS to inline CSS?

Tags:

html

css

gmail

I'm writing a HTML/CSS email template to be triggered for Gmail and other mails. However, Gmail does not load the <style> blocks, so I have to use inline 'style' attribute to make it work.

To illustrate the problem:

<style>
    .center {
        text-align:center;
    }
</style>
<a class="center"> text </a>

Transform to:

<a class="center" style="text-align:center;"> text </a>

Does anyone here know a better way or any program for doing it?

like image 860
Alvaro Joao Avatar asked Sep 29 '15 20:09

Alvaro Joao


1 Answers

There is a web app which is designed for the job.

Converts CSS rules into inline style attributes

https://inlinestyler.torchbox.com/

like image 55
Stickers Avatar answered Oct 04 '22 12:10

Stickers