变相实现textarea文本域

效果图:

 

html:

            <div>
                <form action="">
                    <div class="ta-div" contenteditable="true"><br /></div>
                    <input type="button" value="发布" class="mtb60 btn btn-lg cf bgc-52c4d5 pct40">
                </form>
            </div>

 

css:

            .ta-div{
                width: 100%;
                min-height: 200px;
                max-height: 400px;
                height: 200px;
                border: 1px solid #8b8b8b;
word-wrap: break-word;
overflow-y: auto;
}
.bgc-52c4d5 {
    background-color: #52c4d5;
}
.cf {
    color: #fff;
}
.mtb60 {
    margin-top: 60px;
    margin-bottom: 60px;
}
.pct40 {
    width: 40%;
}
.btn-lg {
    padding: 10px 16px;
    font-size: 18px;
    line-height: 1.3333333;
    border-radius: 6px;
}
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
}

 

转载于:https://www.cnblogs.com/Harold-Hua/p/5553451.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值