注册 登录
编程论坛 ASP技术论坛

为什么文本框的宽度会显示成不一样

robinbest 发布于 2008-04-18 15:19, 1159 次点击

如下代码定义的两个文本框,一个是"text", 一个是"password",在IE6中显示的宽度为何会不一样长(如下面附件图所示)?
<form name="form1" method="post" action="">
    用户名:<input type="text" name="textfield" >
    密  码: <input type="password" name="textfield2" >
</form>
同样的页面在IE7中打开就是一样宽了,注:在其中加
style="width:150" 或 size="20" 或 maxlength="100" 都没效果!
3 回复
#2
makebest2008-04-18 15:43
不会吧, 加了 style="width:150" 后显示是一样长的了.
<form name="form1" method="post" action="">
<input type="text" name="textfield" style="width:150" ><BR>
<input type="password" name="textfield2" style="width:150" >
</form>
#3
robinbest2008-04-18 22:19
[bo]以下是引用 [un]makebest[/un] 在 2008-4-18 15:43 的发言:[/bo]

不会吧, 加了 style="width:150" 后显示是一样长的了.



 


找到原因了,原来是我书写错误,<input type="text" name="textfield" style="width:150;" >
少了个;号,哎呀!
#4
chenzr2008-04-19 17:38
可是在IE6中为什么会出现这样的情况啊.我想知道
1