有没有人获得过使用Twitter Bootstrap的HTML电子邮件? [英] Has anyone gotten HTML emails working with Twitter Bootstrap?

查看:102
本文介绍了有没有人获得过使用Twitter Bootstrap的HTML电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 premailer-rails3 gem,它为html电子邮件内联样式,我试图让它与Twitter引导一起工作。



https://github.com/fphilipe/premailer-rails3 p>

看起来有些样式正确,但不是全部。我想知道是否有人有一个很好的工作示例,让他们的Twitter Bootstrap css(修改或不)到一个HTML电子邮件。



谢谢!

解决方案

如果您的意思是我可以在电子邮件中使用Bootstrap的风格演示吗?那么你可以,但我不知道任何人已经做到了。不过,您需要重新编码表格中的所有内容。



如果您在功能之后,取决于您的电子邮件地址。如果您的用户中有相当比例的用户位于Outlook,Gmail,Yahoo或Hotmail(通常这些用户的总和大约为电子邮件客户端的75%),那么很多Bootstrap的优点是不可能的。 Mac上的Mail,iOS Mail和Gmail在渲染CSS方面效果要好得多,所以如果你的目标主要是移动设备,那就不是那么糟糕。




  • JavaScript - 完全不受限制。如果你尝试,你可能会直接去电子邮件地狱(a.k.a.垃圾邮件文件夹)。这意味着LESS也超出了界限,尽管如果你愿意的话,显然你可以使用结果CSS样式。

  • 内联CSS比任何其他类型的CSS更安全是可能的,链接是肯定的否)。媒体查询是可能的,所以你可以有一些响应式设计。但是,有一长串CSS属性不起作用 - 实质上,电子邮件客户端基本上不支持框模型。您需要使用表格构造所有内容。

  • font-face - 您只能使用外部图像。所有其他外部资源(CSS文件,字体)都被排除在外。

  • 字形和精灵 - 由于Outlook 2007对背景图像(VML)的奇怪实现,您无法使用background-repeat或position。

  • 伪 - 选择器是不可能的 - 例如:hover :活动状态不能单独设置样式


loading < 答案 on 所以,还有很多其他的链接在互联网上。




I'm using the premailer-rails3 gem which pulls styles inline for html emails, and I'm trying to get it working with Twitter bootstrap.

https://github.com/fphilipe/premailer-rails3

It looks like some styles come in correctly, but not all of them. I'm wondering if anyone has a nice working example of getting their Twitter Bootstrap css (modified or not) into an html email.

Thanks!

解决方案

If you mean "Can I use the stylistic presentation of Bootstrap in an email?" then you can, though I don't know anybody that has done it yet. You'll need to recode everything in tables though.

If you are after functionality, it depends on where your emails are viewed. If a significant proportion of your users are on Outlook, Gmail, Yahoo or Hotmail (and these typically add up to around 75% of email clients) then a lot of Bootstrap's goodness is not possible. Mac Mail, iOS Mail and Gmail on Android are much better at rendering CSS, so if you are targeting mostly mobile devices it's not quite so bad.

  • JavaScript - completely off limits. If you try, you'll probably go straight to email hell (a.k.a. spam folder). This means that LESS is also out of bounds, although you can obviously use the resulting CSS styles if you want to.
  • Inline CSS is much safer to use than any other type of CSS (embedded is possible, linked is a definite no). Media queries are possible, so you can have some kind of responsive design. However, there is a long list of CSS attributes that don't work - essentially, the box model is largely unsupported in email clients. You need to structure everything with tables.
  • font-face - you can only use external images. All other external resources (CSS files, fonts) are excluded.
  • glyphs and sprites - because of Outlook 2007's weird implementation of background-images (VML), you cant use background-repeat or position.
  • pseudo-selectors are not possible - e.g. :hover, :active states cannot be styled separately

There are loads of answers on SO, and lots of other links on the internet at large.

这篇关于有没有人获得过使用Twitter Bootstrap的HTML电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆