100% TextArea in FireFox using absolute position

寵の児 提交于 2019-12-10 14:55:23

问题


I'm trying to make my textarea to fill all available space, I used:

I can't use 100% width & height as I have margins & paddings all over the place, I have to use absolute position within relative position parent + top, right, bottom & left all 0 - which doesn't work in FF. Any thoughts on how to fix it?

Update 1 - when I replace my textarea with DIV it starts working.

Update 2 - Actual markup:

    <!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>

回答1:


Mr Snook failed back in march last year, but he suggested a way you could solve it:

wrap the textarea in another element

Does this in any way help you?



来源:https://stackoverflow.com/questions/11756087/100-textarea-in-firefox-using-absolute-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!