About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default iconpremailer Publisher's description

Turns CSS blocks into style attributes

premailer is a Python library that turns CSS blocks into style attributes.

Turns CSS blocks into style attributes

When you send HTML emails you can't used style tags but instead you have to put inline style attributes on every element. So from this:

< html > < style type="text/css" > p { color:red;} < /style > < p >Hej< /p > < /html >

You want this:

< html > < p style="color:red" >Hej< /p > < /html >

premailer does this. It parses an HTML page, looks up style blocks and parses the CSS. It then uses the lxml.html parser to modify the DOM tree of the page accordingly.

Turning relative URLs into absolute URLs

Another thing premailer can do for you is to turn relative URLs (e.g. "/some/page.html" into "http://www.peterbe.com/some/page.html"). It does this to all href and src attributes that don't have a :// part in it. For example, turning this:

< html > < body > < a href="/" >Home< /a > < a href="page.html" >Page< /a > < a href="http://crosstips.org" >External< /a > < img src="/folder/" >Folder< /a > < /body > < /html >

Into this:

< html > < body > < a href="http://www.peterbe.com/" >Home< /a > < a href="http://www.peterbe.com/page.html" >Page< /a > < a href="http://crosstips.org" >External< /a > < img src="http://www.peterbe.com/folder/" >Folder< /a > < /body > < /html >


System Requirements:

В· Python
Program Release Status:
Program Install Support: Install and Uninstall

premailer Tags:

Click on a tag to find related softwares

Is premailer your software?

Manage your software

Most Popular

linux default icon GDB 7.4
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it... Read more
linux default icon Coral 0.9.1
Coral is a tool and a development platform to create and transform models and modeling languages.
linux default icon Forum Paid Plus Script 6.1
Forum Paid Pay Per Post Exchange is targeted at forum owners who wish to...
linux default icon sdo 0.6.5
Converts oracle SDO_GEOMETRY objects to WKT and GeoJSON.
linux default icon Get Paid Plus Script 6.1
Get Paid Plus Script

Related Category

» Other (877)
» Tools & Editors (359)
» Web Development (146)