【问题标题】:How to make emails look good on mobile?如何让电子邮件在手机上看起来不错?
【发布时间】:2014-11-21 23:34:22
【问题描述】:

所以,我有一个时事通讯应用程序,并且我正在使用 Roadie gem,以便我可以将内联样式移动到标题。但是,电子邮件在移动设备上看起来并不是最好的。

确保您的电子邮件模板在小屏幕移动设备上响应良好/看起来不错的最佳方法是什么?

这是我的模板代码:

<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>My Title</title>
<link href="http://fonts.googleapis.com/css?family=Oswald:400,300,700" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700' rel='stylesheet' type='text/css'>
<style type="text/css">
  body{font-family: 'cavier', 'Source Sans Pro', sans-serif;background: #eeeeee;}
  .container{width: 570px;margin: auto;padding: 40px 0;}
  .main {padding: 70px 100px;font-weight: 300;background: #fff;}
  .header{background: #cc0000;padding: 10px 0 5px 25px;min-height: 40px;}
  .logo{float: left;}
  .credo{color: white;font-style: italic;font-size: 12px;margin-left: 230px;margin-top: 10px;}
  .footer {background: #7e7e7e;text-align: center;color: #fff;font-weight: 100;padding: 15px 0;}
  .unsubscribe {text-align: center;color: #fff;font-weight: 100;padding: 15px 0;}
  .h8{font-size: 28px; font-weight: 300;}
  .red, .red a{color: #d93f3f;text-decoration: none;}
  div.text{font-size: 20px;color:#616161;margin-bottom: 5px;}
  .justify{text-align: justify;}
  .blue, .blue a{color: #3fb2ff;}
  .get_started{background: #66ccff;color: #fff;text-decoration: none;padding: 10px 30px;font-weight: 400;font-size: 22px;}
  .branding {color: white; font-weight: normal;}
</style>
</head>
<body>
  <div class="container">
    <div class="header">
      <%= image_tag 'logo.png', class: 'logo' %>
      <div class="credo">Credo here</div>
    </div>
    <div class="main"><%= yield %></div>

  </div>
</body>
</html>

请指教。

【问题讨论】:

  • 这里的任何帮助都会很棒。干杯!

标签: html ruby-on-rails css ruby-on-rails-4


【解决方案1】:

我想说记住这一点很重要:

  1. 不要过度设计。保持简单,创​​建的对象越多,出错的机会就越大。

  2. 更好 - 将您的设计限制为单列 - 可能两侧有空白区域和包含您的内容的单列。

  3. 试试这个网站。它会向您展示您的设计在不同分辨率下的外观。

http://quirktools.com/screenfly/

【讨论】:

    猜你喜欢
    • 2014-07-17
    • 1970-01-01
    • 1970-01-01
    • 2016-09-03
    • 2014-07-05
    • 2020-05-30
    • 1970-01-01
    • 1970-01-01
    • 2018-12-02
    相关资源
    最近更新 更多