【问题标题】:Focus Placeholder of Input with Focus [duplicate]带焦点的输入的焦点占位符[重复]
【发布时间】:2019-11-27 23:46:33
【问题描述】:

有没有办法让有焦点的元素的占位符伪元素聚焦?

下面的代码似乎都不起作用。

input:focus > ::placeholder {
  /* code here */
}

input:focus > input::placeholder {
  /* code here */
}

【问题讨论】:

    标签: css focus placeholder pseudo-element


    【解决方案1】:

    我在发帖前就想到了这一点,但我想我还是会发布它以防其他人正在寻找答案。

    input:focus::placeholder {
      /* code here */
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-29
      • 2013-11-09
      • 2017-07-03
      • 2021-02-15
      • 1970-01-01
      • 2015-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多