【发布时间】:2017-02-25 11:08:48
【问题描述】:
我需要将font-size 调整到input 的高度。 Input 看起来像这样:
<input type="text" id="inputt" name="test" value="ddpp" style="height:100px; width:200px; font-size:100px; line-height:100px; font-family: 'Times New Roman'">
如您所见,height、font-size 和 line-height 属性等于 100px。当我alert() 这些属性由jquery 在页面加载后所有values 等于100px。但是input 中的文本不适合input height。
我也尝试使用span:
<span id="spann1" style="height:100px;font-size: 100px;border: 1px solid red;font-family: 'Times New Roman'">ddpp</span>
因此,span 的 height 已更改为 113px,line-height 变为 142px。为什么?这是否意味着font-size: 100px 在现实中不是100px。那么它是如何工作的呢?
【问题讨论】:
标签: html input height font-size