【问题标题】:Font:size not working in ipad for Html table字体:大小在 ipad 中无法用于 Html 表格
【发布时间】:2014-01-10 09:35:36
【问题描述】:

我编写了简单的 html 布局,对于一个 html 表格,我设置了 font-size:9px;现在当我在 ipad 中查看时,我的字体比那个大,例如我已经这样设置了

<td width="52" height="56" valign="top" style="font-size:9px;font-family:Arial, Helv
etica, sans-serif;">
<div align="left" style="text-decoration:none;font-size:9px;font-family:Arial, 
Helvetica, sans-serif;color:#333333;">

Text goes here 

</div>
</td>

我有 div 的 gine 内联样式,甚至 td 的内联样式,但它不起作用,我确实尝试过

@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
    body{font-size:9px !important;}
 }

但它看起来仍然超过 12 像素,我如何将它设置为 ipad 的 11 像素,请帮助我。

【问题讨论】:

  • 看起来更大,还是更大?你有萤火虫吗? (是的,您可以在 iPad 上使用 Firebug)。
  • 它看起来更大,可能继承了我正在使用 litmus.com cant firebug 检查的其他代码
  • 你为什么不能 Firebug?谷歌Firebug iPad,您会发现几篇文章将指导您如何在 iPad 上安装/使用 Firebug。
  • 我正在使用 litmus.com 对其进行测试,它会给我它的外观截图,我没有 ipad :)

标签: css ipad html media-queries


【解决方案1】:

iPad 和 iPhone 将最小文本设置为 15 像素或类似的东西。在样式中添加“-webkit-text-size-adjust: none”

【讨论】:

    【解决方案2】:

    使用 em 值。

    html {
      font-size: 100%;  //16px
    }
    body {
      font-size:68.75%;  //11px
    }
    
    table {
      font-size:0.8181em;  //9px
    }
    

    现在所有将基于 11px = 1em;如果你想要 14px 那么它将是 14/11 = 1.2727em

    @media only screen 
     and (min-device-width : 768px) 
     and (max-device-width : 1024px) {
         table {font-size:0.8181em;}
     }
    

    【讨论】:

      猜你喜欢
      • 2017-05-13
      • 1970-01-01
      • 2015-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-23
      • 2013-02-03
      • 2014-07-08
      相关资源
      最近更新 更多