css - 如何让textarea placeholder 文字垂直居中?

查看:1500
本文介绍了css - 如何让textarea placeholder 文字垂直居中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

如题,有没有一种办法让textarea 中的placeholder文字垂直居中呢

解决方案

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    #textArea {
      color: white;
      height: 50px;
    }
    #textArea::-webkit-input-placeholder{
      height: 50px;line-height: 50px
    }    /* 使用webkit内核的浏览器 */
    #textArea:-moz-placeholder{
      height: 50px;line-height: 50px
    }                  /* Firefox版本4-18 */
    #textArea::-moz-placeholder{
      height: 50px;line-height: 50px
    }                  /* Firefox版本19+ */
    #textArea:-ms-input-placeholder{
      height: 50px;line-height: 50px
    }
  </style>
</head>
<body>
  <textarea id="textArea" name="" placeholder="请输入"></textarea>
</body>
</html>

这篇关于css - 如何让textarea placeholder 文字垂直居中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆