答案 0 :(得分:3)
请查看此链接JsFiddle
<强> HTML:强>
<!-- Search, search, search and search! -->
<input type="search" name="search" placeholder="search" rel="search" />
<强> CSS:强>
input {
background-image: url(https://cdn4.iconfinder.com/data/icons/round-mobile-ui-set/512/letter-message-email-mail-20.png);
background-position: 10px center;
background-repeat: no-repeat;
border: 1px solid #ccc;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
padding: 10px 5px 10px 20px;
text-indent: 20px;
-webkit-transition: all 0.2s;
-moz-transition: all 2s;
transition: all 0.2s;
width: 200px;
}
如何在占位符中添加精彩图标, 请查看此jsFiddle