0

Does anybody meet this requirement: I use Bootstrap css to build a html page. And I want to send this html content by email. I can use "$('#myelement').html();" to get its detailed content. But it is without css style. How can I convert Bootstrap css style to plain html, like ?

Really appericate your any idea.

amphetamachine
  • 27,620
  • 12
  • 60
  • 72
Haimei
  • 12,577
  • 3
  • 50
  • 36
  • 1
    You mean loke inline styling? – Yan Foto Feb 09 '15 at 21:54
  • 1
    Is the goal of that is having a responsive email? If it is the case, It is not gone work unfortunatly, email clients rarely interpret "float" or even media queries – Yooz Feb 09 '15 at 22:00
  • yes. i want to use the css style which already defined in bootstrap directly. – Haimei Feb 09 '15 at 22:21
  • Thanks everybody's comment, I already get idea about it. I find a good link to do it, nothing with Bootstrap, but still useful for me: http://webdesign.tutsplus.com/articles/build-an-html-email-template-from-scratch--webdesign-12770 I will close this question. – Haimei Feb 10 '15 at 16:33
  • possible duplicate of [Best Practices & Considerations when writing HTML Emails](http://stackoverflow.com/questions/2229822/best-practices-considerations-when-writing-html-emails) – Haimei Feb 10 '15 at 16:34

3 Answers3

1

Unfortunately most email clients will not accurately display an embedded stylesheet; you'll need to use inline styles and tables instead of floats, etc. Check out this thread: Best practices for styling HTML emails. Hubspot also does a great job of outlining some of the differences between web and email CSS.

Community
  • 1
  • 1
grownupteeth
  • 131
  • 2
  • 12
1

You can try Emogrifier for converting External Css to Inline.

It will helps to convert and make reliable for E-mail view.

Shankar Thiyagaraajan
  • 1,705
  • 4
  • 28
  • 46
0

There is whole lot of differences between standard HTML + CSS as rendered in modern browsers and what actually works in HTML based email. The latter is much less standardised. Typically, you would expect to use inline styles rather than a embedded stylesheet for a lot of the CSS content to work.

This has already been discussed on this thread: Best Practices & Considerations when writing HTML Emails

Community
  • 1
  • 1
Chris Walsh
  • 3,423
  • 2
  • 42
  • 62