让textArea的placeholder垂直居中,输入文字时不会居中

<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>

 

转载于:https://www.cnblogs.com/island1994/p/9221284.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在uniapp,可以使用以下两种方式设置textareaplaceholder样式: 第一种方式是在行内直接设置样式,如: <textarea id="textArea" name="" placeholder="请输入" style="color: white; height: 50px;"></textarea> [1] 第二种方式是通过设置placeholder-class属性,并在样式表定义样式类,如: <textarea id="textArea" name="" placeholder="请输入" placeholder-class="custom-placeholder"></textarea> <style> .custom-placeholder { color: red; } </style> [2] 以上两种方式都可以实现textareaplaceholder样式定制化。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [如何让textarea placeholder 文字垂直居中?](https://blog.csdn.net/qq_36140085/article/details/83270749)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [placeholder样式自定义(uniapp 微信小程序、h5)](https://blog.csdn.net/maoge_666/article/details/131890314)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值