看到这个 js fiddle。
html:
<div></div>
<textarea>something here...</textarea>
CSS:
textarea {
height: 1em;
float:left;
padding: 0.5em;
border-width: 1px;
border-color: #ff0000;
border-style: solid;
margin: 0;
width: 20em;
}
div {
height: 2em;
float:left;
width: 2em;
margin: 0;
padding: 0;
border-width: 1px;
border-color: #ff0000;
border-style: solid;
margin: 0;
}