Comments (10)
No worries, that's where I ended up with the issue as well. I appreciate you taking the time to look into it! Have a great day. :)
from email-lab.
It seems my note above did the opposite of what I'm describing, lol.
Example: > becomes & g t ;
from email-lab.
hi @judah-firewood!
Not sure I understand how this is manifesting itself. Let's say you have:
.inner > tbody {
color: #000;
}
It should inline the CSS like this in the HTML:
<div class="inner">
...
<tbody style="color:#000;">
...
</div>
Where is the .inner > tbody
string getting added to the HTML?
from email-lab.
Correct, the inline-css works as you've described. However, I'm adding media queries which are getting added to the 'style' tag, just within the 'body' in the HTML.
from email-lab.
Same place that .ExternalClass and #backgroundTable can be found in the HTML of a build from project init.
from email-lab.
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="-ms-text-size-adjust: none; -webkit-text-size-adjust: none; background: #f2f2f2; height: 100% !important; margin: 0; mso-line-height-rule: exactly; padding: 0; width: 100% !important" bgcolor="#f2f2f2">
<style type="text/css">
body {
width: 100% !important;
margin: 0;
padding: 0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
.ExternalClass {
width: 100%;
}
.ExternalClass {
line-height: 100%;
}
#backgroundTable {
width: 100% !important;
margin: 0;
padding: 0;
line-height: 100% !important;
}
@media only screen and (max-width: 640px) {
.inner > tbody {
display: block !important;
max-width: 600px !important;
width: 100% !important;
height: auto !important;
}
.inner > tbody > tr {
display: block !important;
max-width: 600px !important;
width: 100% !important;
height: auto !important;
}
.inner > tbody > tr > td {
display: block !important;
max-width: 600px !important;
width: 100% !important;
height: auto !important;
}
}
</style>
from email-lab.
Apologies for the formatting
from email-lab.
Thanks for the rendered output example. I understand now. Also, I updated your code snippet to use triple backticks. That preserves your line-breaks. I'll look into it.
from email-lab.
Awesome, thanks!
from email-lab.
@judah-firewood, I was able to replicate your problem. Unfortunately, I don't see an immediate solution. The source of the problem is Premailer. They encode the HTML and there isn't an option to prevent that. Also, they are moving the styles that can't be inlined (like your media query rules) inside of the <body>
element instead of inside the <head>
element. If they put it inside the head this encoding probably wouldn't happen. See this issue with a similar complaint.
I'd recommend you post your problem in the Premailer issue queue. Also, consider rewriting your media query styles to prevent having to use the direct descendent selector which is being encoded.
Sorry, I couldn't be more helpful.
from email-lab.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from email-lab.