根据评论,我猜想您想要一个输入字段,其中包含HTML代码作为默认文本。您必须使用引号和小于/大于符号的字符引用代码。
<input type="text" value="<a href="http://www.mysite.com/link" target="_blank"><img src="http://www.mysite.com/img.jpg" border="0" alt="mysite.com"></a>" />
1:
.myInput { background:url(path/to/img.jpg) 5px 5px no-repeat; }
2:
HTML
<div class="inputContainer">
<input class="myInput" type="text" name="myInput" id="myInput" />
<a href="#" class="inputImg"><img src="#" /></a>
</div>
CSS
.inputContainer { position:relative; }
.myInput { padding-left:25px; /* This will move the text from under the image */ }
.inputImg { left:5px; position:absolute; top:5px; z-index:5; }
根据您的输入大小、图像大小和一般位置,您需要调整位置和值,但这应该可以满足您的要求。
background-image
。