+ -
当前位置:首页 → 问答吧 → input宽度如何兼容各浏览器?

input宽度如何兼容各浏览器?

时间:2011-08-26

来源:互联网

input文字域宽度,ie,chrome,firefox默认都不一样,ie正常的到firefox下就宽出很多,这个怎么统一?

作者: hq22   发布时间: 2011-08-26


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>input宽度如何兼容</title> <style type="text/css"> input{width:100px;border:1px solid red;padding:0;height:20px;} </style> </head> <body> <input type="text" /> </body> </html>
 提示:您可以先修改部分代码再运行
宽度都不统一,你没事吧?我还以为你要问高度不统一呢。我觉得,你要是苛刻,就应当问怎么文字还不居中呢?
如何搞定文字在IE下的居中问题?

作者: xmlovedoudou   发布时间: 2011-08-26