【问题标题】:100% TextArea in FireFox using absolute position使用绝对位置在 FireFox 中 100% TextArea
【发布时间】:2012-08-01 09:11:57
【问题描述】:

我正在尝试让我的textarea 填满所有可用空间,我使用了:

我不能使用 100% width & height 因为我到处都有边距和填充,我必须在相对位置父内使用绝对位置 + top, right, bottom & left 全为 0 - 这在 FF 中不起作用。关于如何解决它的任何想法?

更新 1 - 当我将 textarea 替换为 DIV 时,它开始工作。

更新 2 - 实际标记:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <div style="position: relative; margin: 25px; width: 200px; height: 200px; background-color: Gray;">
        <textarea style="top: 0px; right: 0px; bottom: 0px; left: 0px; position: absolute;">A</textarea>
    </div>
</body>
</html>

【问题讨论】:

  • 给我们看一些代码。我们饿了
  • 帖子已更新。在 Chro-Chro 中检查,然后在 FF 中检查。

标签: html textarea css-position


【解决方案1】:

去年 3 月,Snook 先生失败了,但他提出了一种可以解决的方法:

wrap the textarea in another element

这对你有什么帮助吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-20
    • 1970-01-01
    • 1970-01-01
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 2017-06-09
    相关资源
    最近更新 更多