Textarea在IE中的100%高度 [英] Textarea 100% height in IE

查看:295
本文介绍了Textarea在IE中的100%高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让我的< textarea> 具有100%的高度并在IE7 / 6中工作? height:100%在所有其他浏览器中正常工作,但IE不想接受除特定值以外的任何东西。

How do I get my <textarea> to have a height of 100% and work in IE7/6? height:100% works fine in all other browsers but IE just doesn't want to accept anything other than specific values. Javascript is a possible solution.

推荐答案

为了使元素在IE6中实现100%的高度,您需要指定一个其父元素的固定高度。如果要将元素设置为页面的全长,请应用高度:100%;

In order for an element to achieve 100% height in IE6, you will need to specify a fixed height of its parent element. If you want to make the element the full-length of your page, apply height:100%; to both the html and body elements.

/*100% height of the parent element for IE6*/ 
#parent {height:500px;}
#child {height:100%;}

/*100% of the page length for IE6*/ 
html, body {height:100%;}
#fullLength {height:100%;}

a href =http://www.virtuosimedia.com/tutorials/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs#one-hundred-percent-height =nofollow noreferrer> http://www.virtuosimedia.com/

Taken from: http://www.virtuosimedia.com/

我猜这同样适用于IE7。

I'm guessing the same applies for IE7.

这篇关于Textarea在IE中的100%高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆