我目前正在使用具有背景的文本框.我想知道是否可以将文本(垂直)置于文本框内.
重要的是:它完全集中在firefox中.只有IE它出于某种原因写得太高了.我已经尝试过行高,填充和边距.什么都行不通.有任何想法吗?
编辑:这是我目前的CSS.我应该说我已经尝试过margin-top方法而且它对我不起作用.另外,正如我所提到的,这只适用于IE.我有IE特定的样式表,所以不用担心.
.textValue { color: black; font-size: 12px; font-family: David, sans-serif; }
input { width: 110px; padding: 0 2px; padding-right: 4px; height: 20px; border: solid 1px white; margin-bottom: 0px; background: url(../images/contactTextBg.png) no-repeat top right; }
label { float: right; margin-left: 5px; font-size: 13px; }
Run Code Online (Sandbox Code Playgroud)
对于IE,我有以下内容:
.textValue { font-size: 14px; }
Run Code Online (Sandbox Code Playgroud)
至于HTML:
<tr>
<td><label for="name">name</label></td>
<td><input type="text" name="name" id="name" class="textValue" value="" /></td>
</tr>
Run Code Online (Sandbox Code Playgroud)
谢谢,阿米特
我想知道你如何能够在文本框中对齐文本,但是既然你说,这是建议:
对于idiot IE,你可以使用这个IE特定的黑客:
margin-top:50px; /* for standard-compliant browsers */
*margin-top:50px; /* for idiot IE */
_margin-top:50px; /* for idiot IE */
Run Code Online (Sandbox Code Playgroud)
如果你想要而不是,你可能想尝试其他类似的属性margin-top
.