变相实现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;
}

 

posted @ 2016-06-02 16:14  嘆世殘者——華帥  阅读(122)  评论(0编辑  收藏  举报