文本区域滚动条
我希望以下文本区域在 text.txt 中的内容填满超过文本区域窗口时允许滚动。另外,我希望它自动滚动到文本区域字段的底部。这可能吗?
<textarea class="textarea" id="textarea" readonly="readonly" " rows="20">
<?php
//$date=date(dmY);
$file = fopen("text.txt", "r");
while(!feof($file)){
echo fgets($file);
}
fclose($file);
?>
</textarea>
谢谢。
I want the following textarea to allow scrolling when the stuff inside text.txt fills up more than the textarea window. Also, I want it to auto scroll to the bottom of textarea field. Is this possible?
<textarea class="textarea" id="textarea" readonly="readonly" " rows="20">
<?php
//$date=date(dmY);
$file = fopen("text.txt", "r");
while(!feof($file)){
echo fgets($file);
}
fclose($file);
?>
</textarea>
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 CSS,它将确保您在文本太多时获得垂直滚动条:
对于滚动到文本区域的底部,显然您需要 JS。
请参阅此问题。
This is the CSS that will make sure you get a vertical scrollbar when there is too much text in:
For scrolling to bottom of textarea, clearly you need JS for that.
See this problem.