为什么IE让密码框小于文本框? [英] Why does IE make password boxes smaller than text boxes?

查看:185
本文介绍了为什么IE让密码框小于文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅下面的简单表格。这只是一个密码框顶部的文本框。如果您在Internet Explorer 7(和8以及其他人)中查看它,文本框比密码框宽10个像素。

 <!DOCTYPE html PUBLIC -  // W3C // DTD HTML 4.01 // EN
http ://www.w3.org/TR/html4/strict.dtd>

< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = utf-8>
< title> IE文本与密码测试< / title>
< / head>
< body>

< form action =test>
< p>
< input type =text>< br>
< input type =password>
< / p>
< / form>

< / body>
< / html>

有没有办法通过CSS或向HTML添加内容来全局修复 ?

解决方案

因为在这些类型的字段中使用了不同的字体。

修正只是指定所有输入使用相同的字体。

 < style type =text / css> ; 
input {
font-family:sans-serif;
}
< / style>


See the simple form below. It's just a text box on top of a password box. If you look at it in Internet Explorer 7 (and 8, and probably others) the text box is 10 pixels wider than the password box.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>IE Text vs. Password test</title>
</head>
<body>                 

<form action="test"> 
  <p>
    <input type="text"><br>  
    <input type="password">      
  </p>
</form>          

</body>
</html>   

Is there a way to "fix" that globally, either through CSS or by adding something to the HTML?

解决方案

Because different font is used in those types of fields.

The fix is simply to specify that all inputs use the same font.

<style type="text/css">
  input {
      font-family: sans-serif;                
  }
</style>     

这篇关于为什么IE让密码框小于文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆