文本框内嵌背景的疑问
时间:2010-06-03
来源:互联网
复制内容到剪贴板
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>AutoComplete</title>
<style type="text/css">
.layer{
width:100px;
height:200px;
position:absolute;
background:#6595d6;
z-index:999;
margin:0;padding:0;border:1px solid black;background-color:#fff;position:absolute;top:20px;left:0px; clear:both;
filter:alpha(opacity=70); opacity:0.7;
}
.autoComplete{
/*
background-image:url(http://bbs.blueidea.com/attachment.php?aid=145274&k=41c067d9a25e9c692ce538b5dc63db77&t=1275533758&noupdate=yes);
background-position:right center;
background-repeat:no-repeat;*/
cursor:pointer;
border:1px solid #ccc;
padding:1px 20px 1px 1px;
background:url(sel.gif) no-repeat right top;
overflow:hidden;
width:100px;
height:18px;
}
.autoComplete:hover{
background-position:right -20px;
}
.div_autoComplete{
border:1px solid #6595d6;
height:24px;
}
.span_selectArrow{
width:17px;
height:20px;
background:url(sel.gif) no-repeat right top;
float:left;
}
</style>
</head>
<body>
<!--<div class="layer"><iframe id="foo" src="about:blank" style="z-index:1 ; display: none; border: none; margin: 0; padding: 0; position: relative; width: 100%; height: 100%; top: 0; left: 0;"></div>
-->
<!--<div class="layer">
<iframe frameborder="0" style="position: absolute; width: 100%; z-index: -1; border-top-color: currentColor; border-left-color: currentColor; border-right-color: currentColor; border-bottom-color: currentColor; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-style: none; border-left-style: none; border-right-style: none; border-bottom-style: none; height: 56px"/>
</div>
-->
<div class="layer"></div>
dfdff
<select>
<option>
去人可如今
</option>
<option>
testing
</option>
<option>about</option>
</select>
<div class="div_autoComplete"><span></span></div>
<input type="text" id="txtAuto" class="autoComplete" >
<input type="text" class="autoComplete">
<br />
<input type="text" style="float:left"><span class="span_selectArrow"></span>
df;gfgjfkgf
</body>
</html>
代码:
<!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>AutoComplete</title>
<style type="text/css">
.layer{
width:100px;
height:200px;
position:absolute;
background:#6595d6;
z-index:999;
margin:0;padding:0;border:1px solid black;background-color:#fff;position:absolute;top:20px;left:0px; clear:both;
filter:alpha(opacity=70); opacity:0.7;
}
.autoComplete{
/*
background-image:url(http://bbs.blueidea.com/attachment.php?aid=145274&k=41c067d9a25e9c692ce538b5dc63db77&t=1275533758&noupdate=yes);
background-position:right center;
background-repeat:no-repeat;*/
cursor:pointer;
border:1px solid #ccc;
padding:1px 20px 1px 1px;
background:url(sel.gif) no-repeat right top;
overflow:hidden;
width:100px;
height:18px;
}
.autoComplete:hover{
background-position:right -20px;
}
.div_autoComplete{
border:1px solid #6595d6;
height:24px;
}
.span_selectArrow{
width:17px;
height:20px;
background:url(sel.gif) no-repeat right top;
float:left;
}
</style>
</head>
<body>
<!--<div class="layer"><iframe id="foo" src="about:blank" style="z-index:1 ; display: none; border: none; margin: 0; padding: 0; position: relative; width: 100%; height: 100%; top: 0; left: 0;"></div>
-->
<!--<div class="layer">
<iframe frameborder="0" style="position: absolute; width: 100%; z-index: -1; border-top-color: currentColor; border-left-color: currentColor; border-right-color: currentColor; border-bottom-color: currentColor; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-style: none; border-left-style: none; border-right-style: none; border-bottom-style: none; height: 56px"/>
</div>
-->
<div class="layer"></div>
dfdff
<select>
<option>
去人可如今
</option>
<option>
testing
</option>
<option>about</option>
</select>
<div class="div_autoComplete"><span></span></div>
<input type="text" id="txtAuto" class="autoComplete" >
<input type="text" class="autoComplete">
<br />
<input type="text" style="float:left"><span class="span_selectArrow"></span>
df;gfgjfkgf
</body>
</html>
<!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>AutoComplete</title> <style type="text/css"> .layer{ width:100px; height:200px; position:absolute; background:#6595d6; z-index:999; margin:0;padding:0;border:1px solid black;background-color:#fff;position:absolute;top:20px;left:0px; clear:both; filter:alpha(opacity=70); opacity:0.7; } .autoComplete{ background-image:url(http://bbs.blueidea.com/attachment.php?aid=145274&k=41c067d9a25e9c692ce538b5dc63db77&t=1275533758&noupdate=yes); background-position:right center; background-repeat:no-repeat; cursor:pointer; border:1px solid #ccc; padding:1px 20px 1px 1px; overflow:hidden; width:100px; height:18px; } .autoComplete:hover{ background-position:right -20px; } .div_autoComplete{ border:1px solid #6595d6; height:24px; } .span_selectArrow{ width:17px; height:20px; background:url(sel.gif) no-repeat right top; float:left; } </style> </head> <body> <!--<div class="layer"><iframe id="foo" src="about:blank" style="z-index:1 ; display: none; border: none; margin: 0; padding: 0; position: relative; width: 100%; height: 100%; top: 0; left: 0;"></div> --> <!--<div class="layer"> <iframe frameborder="0" style="position: absolute; width: 100%; z-index: -1; border-top-color: currentColor; border-left-color: currentColor; border-right-color: currentColor; border-bottom-color: currentColor; border-top-width: 0px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-style: none; border-left-style: none; border-right-style: none; border-bottom-style: none; height: 56px"/> </div> --> <div class="layer"></div> dfdff <select> <option> 去人可如今 </option> <option> testing </option> <option>about</option> </select> <div class="div_autoComplete"><span></span></div> <input type="text" id="txtAuto" class="autoComplete" > <input type="text" class="autoComplete"> <br /> <input type="text" style="float:left"><span class="span_selectArrow"></span> df;gfgjfkgf </body> </html>
提示:您可以先修改部分代码再运行
如上面的代码所示:当文字打多的时候在IE中背景会消失后再显示出来,而在FF中是正常的,指教各位是什么原因,谢谢!提示:您可以先修改部分代码再运行
[ 本帖最后由 samlin 于 2010-6-3 11:01 编辑 ]
附件

2010-6-3 10:55
作者: samlin 发布时间: 2010-06-03

作者: samlin 发布时间: 2010-06-03
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28