【问题标题】:On input:focus icon color change not working输入时:焦点图标颜色更改不起作用
【发布时间】:2014-08-15 10:30:09
【问题描述】:

我想改变 input:focus 图标的颜色。我已经用“+”方法试过了。但不为我工作。代码在 Jade 和 LESS 中。图标使用了很棒的字体。

翡翠

header
  .search
    input(type="text", placeholder="seach")
    i.fa.fa-search

.search input:focus +  .search i{color: @link-color !important;}

【问题讨论】:

    标签: css less pug


    【解决方案1】:

    .search 不是输入的同级,它是父级。您只需要将图标作为兄弟姐妹。

    .search input:focus + i{color: @link-color !important;}
    

    Demo

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-01
      • 1970-01-01
      • 2019-03-12
      • 1970-01-01
      • 2013-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多