我正在<input type="text">使用
background: #e3e3e6 url(search.jpg) no-repeat 7px 2px;
Run Code Online (Sandbox Code Playgroud)
在左侧.
我想在文本框的另一侧添加其他图像.(右边).最好的方法是什么?
html(使用class属性分隔有和没有背景的元素)
<input type="text" />
Run Code Online (Sandbox Code Playgroud)
CSS示例:
input[type="text"] {
background: url(http://www.placehold.it/20x20&text=left), url(http://www.placehold.it/20x20&text=right);
background-repeat: no-repeat, no-repeat;
background-position: center left, center right;
}
Run Code Online (Sandbox Code Playgroud)
这是一个演示:http://jsfiddle.net/oLd7zdf7/