我试图通过CSS设置TextArea的行和列属性。我要如何在CSS中做到这一点?
发布于 2018-03-05 11:09:23
width
和height
在进入css路由时使用:
<!DOCTYPE html>
<html>
<head>
<title>Setting Width and Height on Textareas</title>
<style>
.comments { width: 300px; height: 75px }
</style>
</head>
<body>
<textarea class="comments"></textarea>
</body>
</html>
发布于 2018-03-05 11:44:19
<textarea rows="4" cols="50"></textarea>
它相当于:
textarea {
height: 4em;
width: 50em;
}
其中1em相当于当前字体大小,因此使文本区域50字符宽。
https://stackoverflow.com/questions/-100003570
复制相似问题