uniapp textarea placeholder样式
时间: 2023-08-17 15:07:10 浏览: 279
textarea 样式
5星 · 资源好评率100%
在uniapp中,可以使用以下两种方式设置textarea的placeholder样式:
第一种方式是在行内直接设置样式,如:
<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]
以上两种方式都可以实现textarea的placeholder样式定制化。<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 ]
阅读全文