html - 非常简单 : textarea with min height-rows and 100% height?

标签 html css

我有一个包含 textarea 元素的 div。
我需要给它正确的垂直尺寸。

容器 Div 的大小合适。 (100%)
我想给出一个最小高度或最小行数,以在必要时提供一个滚动条,以及 100% 的高度(div 的 100%)。
我不能。我不知道该怎么做。我需要一个例子。

最佳答案

最基本的例子是

<html>
<body>

<div style="height:100%;border:1px solid green;">
    <textarea style="min-height:100px;height:100%;width:100%;border:1px solid red;"></textarea>
</div>

</body>

边框仅用于显示尺寸。但在你的情况下,它可能更复杂。请看一个 containing block 的定义和 height calculation .

关于html - 非常简单 : textarea with min height-rows and 100% height?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17761245/

相关文章:

jquery - 如何根据视口(viewport)赋予过渡效果?

php - 将字符串拆分两次并将其放入表中

html - 如果元素受到影响,则 Epub 分页符将元素作为一个整体移动到新页面

javascript - 如何使用 Browserstack 测试输入类型 ="file"

javascript - 下拉列表中的接下来 7 天

html - 如何在不修改填充的情况下将图像放置在 div 中?

jquery - 在表 td 上添加多个类

javascript - div 按最多 4 位数字的价格排序,但不会发生 5 位数字的排序

html - 可调整大小的 DIV 内的流体图像

css - 嵌入式字体 B 和我不在 safari 3.2 上工作