美文网首页
IE对line-height 失效的的解决方式

IE对line-height 失效的的解决方式

作者: 筱筱2019 | 来源:发表于2019-03-10 16:14 被阅读0次

IE对line-height 失效的的解决方式

微软的IE9 + Extjs3.1 确实头疼,在使用了line-height:20px 的Tree的样式,但是一直没有生效,

下面给出3中解决方案:

方案1、加padding-top:

<div style="height:22px;line-height:22px; padding-top:3px;background:red;color:#FFFFFF;font-size:12px;">文字 字</div>

方案2、加overflow:hidden:

<div style="height:25px;line-height:28px;background:red;color:#FFFFFF;font- size:12px; overflow:hidden">文字字</div>

方案3、设置字体为微软雅黑或者宋体

[html] view plain copy print?

font-family: Microsoft YaHei,Arial,Helvetica, sans-serif;  

试了试 ,只有方法1管用!纠结``````

相关文章

网友评论

      本文标题:IE对line-height 失效的的解决方式

      本文链接:https://www.haomeiwen.com/subject/phcuuqtx.html