文本输入框在chrome中未对齐

时间:2014-09-09 09:30:25

标签: javascript html css google-chrome

我遇到了在所有浏览器中对齐输入文本字段,密码文本字段的问题。有什么工作吗?

以下是我定义文本框的代码

<input cssClass="ui-widget ui-corner-all required" id="username" size="50" tabindex="1" path="username" autocomplete="false" htmlEscape="true" cssStyle="height:30px;padding-left: 3px;"/>

现在文本输入字段在IE和Firefox中工作正常,但它从chrome中的div流出....任何解决方法?

1 个答案:

答案 0 :(得分:0)

您需要在CSS声明中确保将输入字段设置为100%或更小,因此它的大小与容器div相关。

此外,您的HTML代码在调用类时会出现一些错误。它应该是这样的:

<input class="ui-widget ui-corner-all required" id="username" size="50" tabindex="1" autocomplete="false" style="height:30px;padding-left:3px;" />

此外,pathhtmlEscape不是输入标记的有效属性 - 请参阅此处:http://www.w3schools.com/tags/tag_input.asp