当placeholder的字体大小跟input大小不一致时,实现placeholder垂直居中

如图:搜索和图标不是垂直居中着实难受

最终通过如下代码实现:

input::-webkit-input-placeholder { 
  transform: translate(0, 2px);
}

posted @ 2019-12-13 14:28  Nayek  阅读(647)  评论(0编辑  收藏  举报