繁体   English   中英

如何将搜索图标放置在输入框的左侧

[英]How to place search icon to the left of the input box

我想在输入的大部分左侧放置清除图标。 这样用户就不需要去输入的另一边,因为输入将覆盖整个屏幕。

我期待我的输出如下所示:

在此处输入图片说明

目前我正在使用以下代码:

 <input type="search" placeholder="please write something to see">

尝试这样的事情:

 <p><i class="classofthex" onclick="document.GetelementById('in1').innerText = ''; " ></i><input id="in1" type="text" placeholder="please write something to see"></p> 

你可以在 bootstrap 中找到 x 图标

通过这个链接

从以下内容应该很清楚:您在以下方面使用了两个 css 属性:

input[type=text]{
background-image: url('/url')
backgroung-repeat: no-repeat
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM