【问题标题】:How to make vertically scrollable text area?如何制作垂直滚动的文本区域?
【发布时间】:2015-08-15 11:32:21
【问题描述】:

我有一个textarea html 元素,其中可能包含 URL。用户应该能够点击这些 URL 来打开它们。目前代码如下:

<textarea rows="26" class="form-control" disabled> {{ text|urlize }}</textarea>

当然,目前那里不支持链接。看起来 textarea 应该用别的东西代替。我尝试改用div,但我不确定如何限制它的高度(对于textarea,我使用了rows="26")并使其可滚动。

【问题讨论】:

  • 无法理解您的问题,您点击文本区域中的链接是什么意思?
  • @AbdelrahmanWahdan,看看这个小提琴 - jsfiddle.net/and7ey/o4zLap5r - 你不能只点击 example.com 来打开它。

标签: html css scroll textarea


【解决方案1】:

请检查此代码

html

<div class="textarea"> </div>

CSS

.textarea{
  width:50%;
  background-color:#eee;
  overflow:hidden;
  height:250px;
  max-height:250px;
  border:1px solid #ccc;
  overflow-y: auto;
}

http://codepen.io/anon/pen/KpYOKq

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-22
    • 2018-12-06
    • 1970-01-01
    • 2019-07-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多