我们可以在 html
的文本字段中显示图像吗?
编辑
我想做的是有一个可编辑
区域,并想在其中添加html
对象(即按钮、图像等)
最佳答案
文本字段中的图像:
你可以用 CSS 做到这一点。
看这个例子:
http://jsfiddle.net/oscarj24/zy7YP/1/
CSS:
.icon {
background:#FFFFFF url(http://icons.iconarchive.com/icons/gakuseisean/ivista-2/16/Start-Menu-Search-icon.png) no-repeat 4px 4px;
padding:4px 4px 4px 22px;
height:18px;
}
HTML:
<input type="text" name="sample" class="icon">
根据您的帖子编辑,这可能有所帮助。
内部有对象的可编辑区域:
关于javascript - 是否可以在 html 文本字段中显示图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10695544/