相对前面一篇文章,这是一个升级版的发帖的例子。直接上代码,样式就不写啦
用到了 创建元素,追加元素,查找子元素,删除元素,过滤内容 ,添加属性 等操作元素的方法
.release{
margin-bottom: 30px;
min-height: 400px;
width: 500px;
margin: 0 auto;
}
.control{
height: 50px;
line-height: 50px;
}
textarea{
width: 500px;
height: 150px;
display: block;
margin-bottom: 20px;
}
.btnRel{
width: 100px;
height: 40px;
background: #CD5C5C;
border: 1px solid #CD5C5C;
border-radius: 3px;
color: #FFF;
float: left;
}
.conut{
float: right;
}
.comment{
background: #DCDCDC;
width: 460px;
min-height: 50px;
margin-top:20px;
border: 1px solid #C0C0C0;
padding: 20px 10px;
}
.comment p{
min-height: 40px;
border-bottom: 1px dashed #F5F5F5;
margin-bottom:10px;
}
.comment span.comtxt{
display: block;
float: left;
background: #FFF;
line-height: 30px;
padding: 0 5px;
max-width: 320px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.comm