做分类信息网站代码,网站策划过程,网站的建设分析,建站服务外贸先发发牢骚#xff0c;万恶的IE啊。这么点问题害我走弯路#xff0c;浪费时间#xff0c;浪费生命。本以为加上background-attachment:fixed;问题就没了#xff0c;结果问题依然存在#xff0c;查资料说好像是ie bug。无语#xff0c;天杀的IE#xff0c;谁叫人家IE是老…先发发牢骚万恶的IE啊。这么点问题害我走弯路浪费时间浪费生命。本以为加上background-attachment:fixed;问题就没了结果问题依然存在查资料说好像是ie bug。无语天杀的IE谁叫人家IE是老大呢还得想办法啊。 方法一此法也是最简单的那就是设定可输入长度。不过觉得有点旁门左道。 View Code 1 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 2 html xmlnshttp://www.w3.org/1999/xhtml 3 head 4 meta http-equivContent-Type contenttext/html; charsetutf-8 5 titletest/title 6 style typetext/css 7 input{ 8 background:url(images/login_usr.gif) no-repeat; 9 border:none;10 width:186px;11 height:26px;12 line-height:26px;13 padding:0 20px;14 }15 /style16 /head17 body18 div idmain19 input typetext idusr maxlength20/20 /div21 /body22 /html 方法二将背景设置到父元素,再具体设置input css样式 View Code 1 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 2 html xmlnshttp://www.w3.org/1999/xhtml 3 head 4 meta http-equivContent-Type contenttext/html; charsetutf-8 5 titletest/title 6 style typetext/css 7 #main{ 8 background:url(images/login_usr.gif) no-repeat; 9 width:226px;10 height:26px;11 line-height:26px;12 }13 input{14 width:204px;15 margin-left:20px;16 height:22px;17 line-height:22px;18 border:0;19 }20 /style21 /head22 body23 div idmain24 input typetext/25 /div26 /body27 /html 方法用img or div(加背景通过position定位。此法没有做只是个思路也应该能实现不过兼容性是个问题。又得hack。 ps:以上测试浏览器ie7/8、firefox、chrome、opera、safari。机器上没有ie6所以没测。 转载于:https://www.cnblogs.com/lonny/archive/2011/04/13/2012981.html