首页 新闻 赞助 找找看

css height=100%在ie6/7下不起作用,请教前端达人?

0
悬赏园豆:50 [已解决问题] 解决于 2012-01-13 11:37

我的代码如下:

<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
body
{
background
: none repeat scroll 0 0 #EFEFEF;
overflow
: hidden;
position
: relative;
margin
: 0px;
padding
: 10px;
}
div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td
{
margin
: 0;
padding
: 0;
}
#content
{
height
:200px;
}
fieldset,textarea
{
border
: 0 none;
}
#LeftPanel
{
width
: 48%;
float
: left;
height
:100%;
}
.window
{
border
: 1px solid #ADADAD;
width
: 100%;
float
: left;
}
.top
{
height
: 25%;
}
.bottom
{
height
: 75%;
}
.code
{
width
:100%;
height
:100%;
}
</style>
</head>
<body>
<div id="content">
<fieldset id="LeftPanel">
<div id="div_A" class="window top">
<textarea id="code_A" class="code">A</textarea>
</div>
<div id="div_B" class="window bottom">
<textarea id="code_B" class="code">B</textarea>
</div>
</fieldset>
</div>
</body>
</html>

在Chrome,FireFox,IE8/9下显示正常,在IE6/7下不起作用。

在FireFox下显示如下 :

在IE6/7下:

请教达人,谢谢!

artwl的主页 artwl | 专家六级 | 园豆:16736
提问于:2012-01-12 13:10
< >
分享
最佳答案
1
<html>
<head>
<style>
body
{
margin
: 0px;
}
div
{
position
: absolute; margin: 2%; width: 96%; height: 96%;
}
textarea
{
position
: absolute; width: 100%; height: 100%;
}
</style>
</head>
<body>
<div>
<textarea></textarea>
</div>
</body>

楼主看下 有没有帮助

收获园豆:30
王那个锋啊 | 菜鸟二级 |园豆:311 | 2012-01-12 16:43

谢谢,你这个是可以用,但在我这个需求中不太好弄,再看看是否有更好的方案吧,没有的话明天结帖

artwl | 园豆:16736 (专家六级) | 2012-01-12 18:21
其他回答(4)
0
收获园豆:5
keenweiwei | 园豆:215 (菜鸟二级) | 2012-01-12 15:09

试过,不行啊

支持(0) 反对(0) artwl | 园豆:16736 (专家六级) | 2012-01-12 16:16
0

推荐一个给力网站给你:http://www.css88.com/jqapi/

悟行 | 园豆:12559 (专家六级) | 2012-01-12 16:00
0

加在那个文本框的下面;“<div style="clear:both;height:0;overflow:hidder" ></div>”

收获园豆:5
画方软件 | 园豆:778 (小虾三级) | 2012-01-12 16:14

试了,不起作用啊

支持(0) 反对(0) artwl | 园豆:16736 (专家六级) | 2012-01-12 16:16

@artwl: 不要用那个100%;都给一个固定值吧;

支持(0) 反对(0) 画方软件 | 园豆:778 (小虾三级) | 2012-01-12 16:21
0

body的宽和高给个值就行了

收获园豆:10
sunlary | 园豆:934 (小虾三级) | 2012-01-13 09:24
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册