日期:2014-05-17  浏览次数:21166 次

【HTML】如何在文本框中插入图片
【HTML】如何在文本框中插入图片

请高手指教。

------解决方案--------------------
<input type="text" class="search" maxlength="180" value="" style="border: 1px solid rgb(165, 165, 167); width: 180px; height: 22px; background-image: url(http://images.51job.com/im/my_history/key_search.gif); background-repeat: no-repeat; line-height: 21px; padding-left: 24px;" id="keyword" name="keyword" autocomplete="off" key="iCom1" vindex="-1" preval="fdd"/>
用的不重复背景图,再用padding-left把文字顶开。
------解决方案--------------------
[code=HTML
<html> 
<body> 
<table align="left" border="0" cellpadding="0" cellspacing="0" width="295">
 <tr>
<td align="left" valign="top"><input preval="" vindex="-1" key="iCom1" autocomplete="off" name="keyword" id="keyword" style="border: 1px solid rgb(165, 165, 167); width: 180px; height: 22px; background-image: url(http://images.51job.com/im/my_history/key_search.gif); background-repeat: no-repeat; line-height: 21px; padding-left: 24px;" value="" maxlength="180" class="search" type="text">
</td>
</tr>
</table>
</body>
</html>
][/code]
把图片换成你自己的就可以了。