1. 程式人生 > >如何讓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>