<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>12.textarea文本域字数限制(1)</title>
<style type="text/css">
.box{
width: 600px;
height: 160px;
border: 10px solid pink;
border-radius: 10px;
margin: 0 auto;
padding: 10px;
}
.box1{
float: left;
margin-left: 255px;
width: 150px;
height: 24px;
text-align: center;
font-size: 14px;
color: #888;
}
.box1 span{
font-size: 16px;
font-weight: bold;
}
#text{
width: 600px;
height: 100px;
border: 1px solid #888;
margin-top: 5px;
}
#btn{
float: right;
border: 0;
border-radius: 4px;
width: 60px;
height: 28px;
line-height: 28px;
background: lightblue;
}
#btn:hover{
background: pink;
outline: none;
color: #fff;
cursor: pointer;
}
</style>
</head>
<body>
<div class="box">
<div class="box1">还可以输入<span id="number">80</span>字</div>
<textarea id="text" placeholder="请输入您的评论..."></textarea>
<button type="button" id="btn">发布</button>
</div>
</body>
</html>