如何在不影响宽度的情况下更改textarea字体大小

How to change textarea font size without affecting the width

如何在不影响textarea框宽度的情况下更改textarea的字体大小?

我通过应用 css 知道,例如:

textarea {
    font-size:16px;
}

但是它会影响文本区域的大小。

代码中你的宽高在css.

textarea {
    width: 500px;
    height: 300px;
}

您也可以在 html 中使用行和列属性执行此操作:

<textarea rows="4" cols="50"></textarea>