关于textarea标签自己遇到的问题

固定文本框尺寸与垂直居中技巧
本文介绍了一种固定文本框宽高并禁止拖拽的方法,同时展示了如何通过CSS使文本框内的提示文字垂直居中显示。适用于不同版本的浏览器,包括使用webkit内核的浏览器和Firefox。
效果描述:
固定文本框的宽高,让文本框不被拖拽,让提示内容的文字垂直居中

html:

<div>
  <label>活动详情</label>
  <textarea class="textarea" placeholder="富文本编辑器" ></textarea>
</div>
css:
.textarea{
width: 41%;
height: 198px;
resize: none;//禁止拖拽文本框
}
//使提示内容垂直居中
/* 使用webkit内核的浏览器 */
.textarea::-webkit-input-placeholder{
height: 200px;
line-height: 200px;
text-align: center;
}
/* Firefox版本4-18 */
.textarea:-moz-placeholder{
height: 200px;
line-height: 200px;
text-align: center;
}
/* Firefox版本19+ */
.textarea::-moz-placeholder{
height:200px;
line-height:200px;
text-align: center;
}
.textarea:-ms-input-placeholder{
height: 200px;
line-height: 200px;
text-align: center;
}
 
 

转载于:https://www.cnblogs.com/lin-white/p/10782256.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值