加入 style="padding-top:2px;" 指定input内部 字体与上面边线的距离
-------------------------------------------------------------------------------------
<input type="submit"
value="文字居中" style="text-align:center; line-height:20px; height:20px;
margin:0px; padding:0px; border:0px;">
或
<input
type="submit" value="文字居中" style="text-align:center; height:20px;
margin:0px; padding-top:5px; border:0px;">
//指定高度和宽度就居中了,
<input type="submit" value="文字居中" style="text-align:center; line-height:20px; height:20px; margin:0px; padding:0px; border:0px;">
<input type="submit" value="文字居中" style="text-align:center; height:30px;width:80">
本文介绍了如何通过调整CSS样式使输入框内的文字居中显示的方法。包括设置文本对齐方式、行高、内边距等属性的具体实现细节。
1万+

被折叠的 条评论
为什么被折叠?



