如何创建可滚动文本框? [英] How do I create a scrollable textbox?
问题描述
目前,网站具有以下css类,用于在表单中用于注释(较长文本)条目。
.scrollabletextbox {
height:100px;
width:200px;
font-family:Verdana,Tahoma,Arial,Helvetica,sans-serif;
font-size:82%;
overflow:scroll;
}
框和其他样式寄存器的大小正确,居中,永远不会换行。完全查看文本的唯一方法是向左/向右移动光标。
表单使用以下html(带有一个php)来实现大文本框
< input type =textclass =scrollabletextboxname =notevalue =<?php echo $ note;?>>感谢您提供任何帮助。 h2_lin>解决方案尝试使用 textarea
标记替换 input type =text
将您的代码更改为:
注意:< / td> ;
< td width =100>
< textarea class =scrollabletextboxname =note>
<?php echo $ note; >
< / textarea>
< br />
它作为正常的输入发送数据
标记,因此您可以从相同的方法获取数据。
有关 textarea
标签的更多信息这里
Currently, the site has the following css class that is intended to be used for note (longer texts) entries in a form.
.scrollabletextbox {
height:100px;
width:200px;
font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
font-size: 82%;
overflow:scroll;
}
The size of the box and other styling register correctly, but the text start vertically centered and never line breaks. The only way to view the text completely is to move the cursor left/right.
The form uses the following html (with a little php) to implement the large text box
<input type="text" class="scrollabletextbox" name="note" value="<?php echo $note; ?>">
Thank you in advance for any help.
解决方案 Try replacing input type="text"
with textarea
tag.
Change your code to:
Note:</td>
<td width="100">
<textarea class="scrollabletextbox" name="note">
<?php echo $note; ?>
</textarea>
<br />
It sends data just as a normal input
tag, so you can get data from it same methods.
More info about textarea
tag here
这篇关于如何创建可滚动文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!