html - bootstrap 4 输入中的 ionicons

标签 html css input

我想用 bootstrap alpha 4 构建一个输入搜索字段,但我使用的不是 glyphicon 图标或字体 awesom,而是 ionicons,我更喜欢它们。

问题是图标总是在输入框下面,我怎么能把它放到输入框里面。

  <div class="input-group">
    <input type="search" class="form-control">
    <span>
        <i class="ion-ios-search-strong pulse-icons "></i>
    </span>
    </div>

enter image description here

最佳答案

你去吧

  <div class="col-xs-12">
    <div class="input-group filter-search">
      <input type="search" class="form-control" placeholder="Filter nach Namen...">
      <span>
        <i class="ion-ios-search-strong pulse-icons"></i>
      </span>
    </div>
  </div>

您不必根据相对值设置它们,输入大多数设置为相对值。

.input-group span {
  position: absolute;
  left: 0;
  z-index: 2;
}  

关于html - bootstrap 4 输入中的 ionicons,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40267439/

相关文章:

html - 与包含数据的 div 等高 - CSS

java - 在 PHP 中接收带有 html 标签的 json 失败

css - 将标题与文本对齐

python - "UnboundLocalError: local variable ' 输入 ' referenced before assignment"

input - Verilog 输入错误

Java 读取原始鼠标输入

html - 为什么我的页脚有一个巨大的差距?

html - 如何居中对齐 Google 广告?

javascript - 浏览器后退按钮不适用于 anchor 链接

css - 样式化 Google Polymer 的纸张 slider 元素