html页面中,文本框里面怎么放图片? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 textarea ?不可以吧只能用 div 或者 iframe 放到textarea中的内容会被当做文字来处理的 用样式,添加个背景图片就可以了。。bginput {background: url(''images/bginput.gif'') #ffffff fixed no-repeat;background-repeat: repeat-x;font-family:ms shell dlg,tahoma,sans-serif,宋体;font-size:12px;border: 1px solid #002040;第二步:把文本框代码<textarea></textarea>修改为类似<textarea class="bginput"></textarea> .text_1 {width:100px;height:20px; border:1px solid #DCDAD8;padding:3px 2px;background:url(图片地址);}<input name="name" id="name" type="text" height="10" size="12" class="text_1" /> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>文本框测试</title> <style type="text/css">.text_1 {width:100px;height:20px; border:1px solid #DCDAD8;padding:3px 2px;background:url(网络图片/别烦我.jpg);}</style> </head> <body> <input name="name" id="name" type="text" height="10" size="12" class="text_1" /> </body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>文本框测试</title> <style type="text/css">.text_1 {width:270px;height:129px; border:1px solid #DCDAD8;padding:3px 2px;background:url(http://img.baidu.com/img/logo-img.gif);}</style> </head> <body> <input name="name" id="name" type="text" height="10" size="12" class="text_1" /> </body></html> 谢谢大家回复,这个正解。如果我想在鼠标或键盘按下的时候消除图片呢?怎么更改css? <style type="text/css">.text_2 {width:270px;height:129px;border:1px solid #DCDAD8;padding:3px 2px;}.text_1 {width:270px;height:129px;border:1px solid #DCDAD8;padding:3px 2px;background:url(http://img.baidu.com/img/logo-img.gif); }</style> <script> function noshow(){ document.getElementById("name").className="text_2"; }</script><body> <input name="name" id="name" type="text" height="10" size="12" class="text_1" onblur="noshow()"/></body> 问一个getSession()的问题 求教spring管理多个sessionFactory问题 from表单提交请求,前台怎么获得out对象的数据 tomcat配置 求助tomcat5.5 我要求救 请高手帮忙:一个jsp系统错误!! java写入 sybase数据库,乱码问题,急!! 到底怎么实现呢????? 救命!中毒了!?以前很正常呀!今晚运行JSP时不知道什么东西给我的JSP文件的末尾加了一段vbscript代码,还莫名奇妙地启动java plug-in到任务 关于在上下文中取值问题 如何在jsp中实现登录功能(举例说明喔)
background: url(''images/bginput.gif'') #ffffff fixed no-repeat;
background-repeat: repeat-x;
font-family:ms shell dlg,tahoma,sans-serif,宋体;
font-size:12px;
border: 1px solid #002040;第二步:
把文本框代码<textarea></textarea>
修改为类似<textarea class="bginput"></textarea>
width:100px;
height:20px;
border:1px solid #DCDAD8;
padding:3px 2px;
background:url(图片地址);
}
<input name="name" id="name" type="text" height="10" size="12" class="text_1" />
<html>
<head>
<title>文本框测试</title>
<style type="text/css">
.text_1 {
width:100px;
height:20px;
border:1px solid #DCDAD8;
padding:3px 2px;
background:url(网络图片/别烦我.jpg);
}
</style>
</head>
<body>
<input name="name" id="name" type="text" height="10" size="12" class="text_1" />
</body>
</html>
<html>
<head>
<title>文本框测试</title>
<style type="text/css">
.text_1 {
width:270px;
height:129px;
border:1px solid #DCDAD8;
padding:3px 2px;
background:url(http://img.baidu.com/img/logo-img.gif);
}
</style>
</head>
<body>
<input name="name" id="name" type="text" height="10" size="12" class="text_1" />
</body>
</html>
谢谢大家回复,这个正解。如果我想在鼠标或键盘按下的时候消除图片呢?怎么更改css?
<style type="text/css">
.text_2 {
width:270px;
height:129px;
border:1px solid #DCDAD8;
padding:3px 2px;
}
.text_1 {
width:270px;
height:129px;
border:1px solid #DCDAD8;
padding:3px 2px;
background:url(http://img.baidu.com/img/logo-img.gif);
}
</style> <script>
function noshow(){
document.getElementById("name").className="text_2";
}
</script>
<body>
<input name="name" id="name" type="text" height="10" size="12" class="text_1" onblur="noshow()"/>
</body>