<!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>无标题文档</title>
<style type="text/css">
<span style="white-space:pre"> </span>/*默认样式重置*/
<span style="white-space:pre"> </span>input{padding: 0;margin: 0;}
<span style="white-space:pre"> </span>
<span style="white-space:pre"> </span>.inputPic{width: 300px;height: 30px;border: 1px solid red; background: url(images/Pic.png) 0 center no-repeat; }
<span style="white-space:pre"> </span>.divPic{width: 300px;height: 30px;border: 1px solid red; background: url(images/Pic.png);}
<span style="white-space:pre"> </span>.divPic input{width: 300px;height: 30px;border: none; background:none;}
</style>
</head>
1.input标签IE6下背景图片bug:
<br />
<input type="text" class="inputPic" name="" />
<hr />
2.解决bug(父级div背景代替input背景):
<div class="divPic">
<input type="text" name="" />
</div>
<body>
</body>
</html>
1.chrome下文本过长时显示效果:
2.IE6下文本过长时显示效果: