做了一个留言板 发现lable 与后面的 textarea总是看起来很别扭,下图 内容俩字跑到最下面了
在 textarea中加一个vertical-align: top;就OK了
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8"/>
<style type="text/css">
#box{
width: 500px;
margin: 50px auto;
border: 1px solid black;
background-color: #cccccc;
}
#box div{
margin: 3px;
}
input {
width: 430px;
}
textarea{
width: 430px;
height: 180px;
/*前面的文本对其*/
vertical-align: top;
/*禁止拉伸*/
resize:none;
font: 20px 'simhei';
}
label{
margin-left: 5px;
}
#btn{
width: 80px;
text-align: center;
height: 25px;
font: