【问题标题】:Email Template using Zurb library not responsive in Firefox使用 Zurb 库的电子邮件模板在 Firefox 中没有响应
【发布时间】:2018-01-27 11:14:50
【问题描述】:

<table class="row">
  <tbody>
     <tr>
        <td class="small-5 large-7 column">
          <p class="heading-text">ITEM</p>
        </td>
        <td class="small-3 large-2 columns space" align="center">
          <p class="heading-text text-center">QTY</p>
        </td>
        <td class="small-4 large-3 columns">
          <p class="heading-text text-right">TOTAL</p>
        </td>
      </tr>
    
      <tr>
        <td class="small-5 large-7 columns space">
          <h6>1613 | <span class="memo-text">Out</span></h6>
          <p class="desc">The framework includes two typographic scalesone uses a narrow range of sizes.</p>
        </td>
        <td class="small-2 large-2 columns space" align="center">
          <h6 class="text-center">15.00</h6>
        </td>
        <td class="small-5 large-3 columns space" align="center">
          <h6 class="text-right">$394,567.00</h6>
          <p class="desc text-right">10.00%</p>
          <p class="desc text-right">$39,800.00</p>
        </td>
      </tr>
  </tbody>
</table>

这两行在 mozilla firefox 的移动视图中无法正确显示。最后一列&lt;p class="heading-text text-right"&gt;TOTAL&lt;/p&gt; 移动下一行。

任何帮助将不胜感激。

【问题讨论】:

  • 你用的是哪个版本?
  • 空间类有什么作用?
  • Mozilla 版本 41.0.2
  • .space{ padding-bottom : 0px !important; margin-bottom : 0px !important; padding-left : 4px !important; padding-right : 4px !important; }
  • 我使用 Zurb css 文件。

标签: html css zurb-foundation html-email


【解决方案1】:

这个与 Firefox 相关的 Foundation-emails 问题仍然存在,但可以通过以下方式修复:

@media only screen and (max-width: 596px) {
  td.small-6, th.small-6 {
    display: table-cell !important;
  }
}

感谢@ryanjavens

要使其适用于您的结构,请尝试以下方法并告诉我您是否可以解决它:

@media only screen and (max-width: 596px) {
    td.small-6, th.small-6,
    td.small-5, th.small-5,
    td.small-4, th.small-4,
    td.small-3, th.small-3,
    td.small-2, th.small-2,
    td.small-1, th.small-1{
        display: table-cell !important;
    }
}

.space {
    padding-bottom : 0px !important;
    margin-bottom :  0px !important;
    padding-left :   4px !important;
    padding-right :  4px !important;
}
<table align="center" class="container float-center">
  <tbody>
    <tr>
      <td>

        <table class="row">
          <tbody>
            <tr>
              <td class="small-5 large-7 column">
                <p class="heading-text">ITEM</p>
              </td>
              <td class="small-3 large-2 columns space" align="center">
                <p class="heading-text text-center">QTY</p>
              </td>
              <td class="small-4 large-3 columns">
                <p class="heading-text text-right">TOTAL</p>
              </td>
            </tr>

            <tr>
              <td class="small-5 large-7 columns space">
                <h6>1613 | <span class="memo-text">Out</span></h6>
                <p class="desc">The framework includes two typographic scalesone uses a narrow range of sizes.</p>
              </td>
              <td class="small-2 large-2 columns space" align="center">
                <h6 class="text-center">15.00</h6>
              </td>
              <td class="small-5 large-3 columns space" align="center">
                <h6 class="text-right">$394,567.00</h6>
                <p class="desc text-right">10.00%</p>
                <p class="desc text-right">$39,800.00</p>
              </td>
            </tr>
          </tbody>
        </table>

      </td>
    </tr>
  </tbody>
</table>

附:如果您必须使用其他尺寸,请将它们添加到规则中,例如添加small-7

@media only screen and (max-width: 596px) {
    td.small-7, th.small-7,
    td.small-6, th.small-6,
    td.small-5, th.small-5,
    td.small-4, th.small-4,
    td.small-3, th.small-3,
    td.small-2, th.small-2,
    td.small-1, th.small-1 {
        display: table-cell !important;
    }
}

JSFiddle

【讨论】:

  • 它工作但我的问题仍然没有解决。当我缩小浏览器响应时不起作用。并在 Mozilla Firefox 中显示水平滚动条。
  • 嗨@NishaPatel,我尝试了使用Foundation for Emails 2.2.0 Sass版本发布的代码(我只在src/pages/index.html中插入了上面的html代码和src/assets/scss/app.scss中的css代码)和Mozilla Firefox 58.0.1(64 位)、Google Chrome 63.0.3239.132(官方版本)(64 位)和 Internet Explorer 11.0.9600.18893;在所有 3 个浏览器中,列都不会中断,水平滚动条不会出现并且从小到大正确传递。试试最新版本的 Foundation for Emails,也许是 Sass。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-08-25
  • 1970-01-01
  • 2015-11-11
  • 2016-12-06
  • 2013-09-16
  • 2019-12-02
  • 1970-01-01
相关资源
最近更新 更多