3

我似乎无法让我的响应式字体大小在我正在创建的电子邮件中工作。问题在于outlook、gmail、aol。

在此处输入图像描述

这是HTML

<th class="small-2 large-2 columns" valign="middle" style="Margin: 0 auto; background-color: #E7E7E7; border: 2px solid #ffffff; color: #0a0a0a; font-family: 'Open Sans', sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0 auto; min-height: 85px; padding: 0; padding-bottom: 16px; padding-left: 0 !important; padding-right: 0 !important; padding-top: 20px; text-align: left; width: 80.66667px;">
   <p class="field text-center" style="Margin: 0; Margin-bottom: 10px; color: #666666 !important; font-family: 'Open Sans', sans-serif; font-size: 8px; font-weight: normal; line-height: 1.75; margin: 0; margin-bottom: 2px; padding: 0; text-align: center;">Price</p>
   <p pardot-region="" class="number text-center" style="Margin: 0; Margin-bottom: 10px; color: #333333; font-family: 'Open Sans', sans-serif; font-size: 10px; font-weight: bold; line-height: 1.75; margin: 0; margin-bottom: 10px; padding: 0; text-align: center;">$512.72</p>
</th>

这是我稍后使用基础内联工具内联的 CSS

.financial-table th p.field {
  color: #666666 !important;
  margin-bottom: 2px;
  font-size: 8px;
}

.financial-table th p.number {
  font-size: 10px;
  color: #333333;
  font-weight: bold;
}

@media only screen and (min-width:500px){

  .financial-table th p.number {
    font-size: 16px !important;
  }
  .financial-table th p.field {
    font-size: 12px !important;
  }
}

我究竟做错了什么?

4

2 回答 2

1

您的代码似乎运行良好,尝试使用 justp.fieldp.numberlike选择段落

p.field {
  color: #666666 !important;
  margin-bottom: 2px;
  font-size: 8px;


}

p.number{
  font-size: 10px;
  color: #333333;
  font-weight: bold;
}

@media only screen and (min-width:500px){

  p.number {
    font-size: 16px !important;
  }
  p.field {
    font-size: 12px !important;
  }
}

这是实时代码。jsfiddle。调整结果框大小以查看效果

于 2018-06-05T19:20:43.063 回答
1

所以最终得到了这个工作。将带有媒体查询的跨度类标签添加到固定的元素

<th class="small-2 large-2 columns" valign="middle" style="Margin: 0 auto; background-color: #E7E7E7; border: 2px solid #ffffff; color: #0a0a0a; font-family: 'Open Sans', sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; margin: 0 auto; min-height: 85px; padding: 0; padding-bottom: 16px; padding-left: 0 !important; padding-right: 0 !important; padding-top: 20px; text-align: left; width: 80.66667px;">
   <p class="field text-center" style="Margin: 0; Margin-bottom: 10px; color: #666666 !important; font-family: 'Open Sans', sans-serif; font-size: 8px; font-weight: normal; line-height: 1.75; margin: 0; margin-bottom: 2px; padding: 0; text-align: center;"><span class="mobile-number">Price</span></p>
   <p pardot-region="" class="number text-center" style="Margin: 0; Margin-bottom: 10px; color: #333333; font-family: 'Open Sans', sans-serif; font-size: 10px; font-weight: bold; line-height: 1.75; margin: 0; margin-bottom: 10px; padding: 0; text-align: center;"><span class="mobile-number">$512.72<span></p>
</th>
于 2018-06-05T21:26:47.573 回答