html - 为什么 <hr> 在 prod 模式下与 watch 模式下不同?

标签 html css zurb-foundation html-email

我正在为我们的内部时事通讯制作电子邮件模板,我想使用专门为创建最佳 html 电子邮件而创建的框架,Foundation for Emails 2 .

很好,但我对 <hr> 有疑问元素。我想给它 100% 的宽度。如果我在 watch 中运行它模式,它有效:

enter image description here

但是如果我运行 build任务,它是这样的(它更短),我真的不知道为什么:

enter image description here

有没有人对这个框架有更多的经验?

墨色:

<container>
    <row>
        <columns class="bigger-space line" large="12">
            <hr />
        </columns>
    </row>
</container>

相关 CSS:

.bigger-space {
  padding-right: 30px !important;
  padding-left: 30px !important;
}

.line {
  padding-bottom: 30px !important;

  tbody tr th:first-child {
    width: 100% !important;
  }
}

在观看模式下生成的 HTML:

<!-- SEPARATOR LINE -->
<table class="container float-center"><tbody><tr><td>
<table class="row"><tbody><tr>
    <th class="bigger-space line small-12 large-12 columns first last">
      <table>
        <tr>
          <th>
            <hr>
        </th>
        <th class="expander"></th>
       </tr>
     </table>
   </th>
</tr></tbody></table>

在构建模式下生成的 HTML:

<table class="container float-center" style="-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;Margin:0 auto;background:#fefefe;border-collapse:collapse;border-spacing:0;float:none;font-weight:400!important;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:500px"><tbody><tr style="padding:0;text-align:left;vertical-align:top"><td style="-moz-hyphens:auto;-ms-text-size-adjust:100%;-webkit-hyphens:auto;-webkit-text-size-adjust:100%;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400!important;hyphens:auto;line-height:19px;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"><table class="row" style="-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;border-collapse:collapse;border-spacing:0;display:table;font-weight:400!important;padding:0;position:relative;text-align:left;vertical-align:top;width:100%"><tbody><tr style="padding:0;text-align:left;vertical-align:top"><th class="bigger-space line small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0 auto;padding:0;padding-bottom:30px!important;padding-left:30px!important;padding-right:30px!important;text-align:left;width:500px"><table style="-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;border-collapse:collapse;border-spacing:0;font-weight:400!important;padding:0;text-align:left;vertical-align:top;width:100%"><tbody><tr style="padding:0;text-align:left;vertical-align:top"><th style="Margin:0;color:#0a0a0a;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0;text-align:left"><hr style="Margin:20px auto;border-bottom:1px solid #cacaca;border-left:0;border-right:0;border-top:0;clear:both;height:0;margin:0!important;max-width:500px"></th><th class="expander" style="Margin:0;color:#0a0a0a;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th></tr></tbody></table></th></tr></tbody></table></td></tr></tbody></table> 

最佳答案

我刚刚找到了一个修复程序,它是 Zurb 框架的问题:https://github.com/zurb/foundation-emails/issues/434 .

HTML:

<row>
  <columns>
    <p class="hr-fix">&nbsp;</p>
    <hr>
  </columns>
</row>

CSS:

.hr-fix{
  line-height: 0px !important;
}

抱歉,下次我应该先检查一下问题。

关于html - 为什么 <hr> 在 prod 模式下与 watch 模式下不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38266169/

相关文章:

javascript - 当用户使用 Dojo 滚动到底部时加载新内容?

css - 如何将 CSS 文件内容导入 Javascript 变量

css - jQuery Ui 按钮字体大小

javascript - 在有滚动条的侧边栏外显示下拉菜单,但仍与 anchor 处于相同位置

javascript - Foundation-Apps angular 站点与 karma-jasmine 单元测试的集成

javascript - 如何在另一个文本框中同时写入文本框值?

javascript - 通过 JS 重叠播放音频

html - tinyMCE - 在移动设备上移动图像并调整其大小

javascript - 如何将 Zurb Foundation 实现到 Rails 7?

css - Foundation fixed top bar,偏移怎么处理