0

我知道,这是一个老问题,但我无法解决这个问题......

见这里:http: //jsfiddle.net/NLRqM/2/

我想让“#main_rechts”DIV 在“#main”内的高度为 100%...(自动与绿色框高度相同)!

非常感谢!

4

4 回答 4

2

#main-rechts是浮动的,所以它不会工作。尝试使用display: tabledisplay: table-cellCSS 属性,但请注意它们在 IE 7 及更低版本中不起作用。

我已经更新了你的小提琴以表明我的意思 - http://jsfiddle.net/Pharaon/NLRqM/5/

于 2012-06-06T08:47:29.860 回答
1

尝试给它们一个min-height: 200px;(或任何其他适合您的设计的值):

#main_links {
  width:680px;
  position:relative;
  float:left;
  background-color:#096;
  min-height:200px;
}
#main_rechts {
  width:260px;
  position:relative;
  float:right;
  background-color:#e7e8e8;
  min-height:200px;
}
于 2012-06-06T08:49:16.503 回答
0

设置一些固定高度#main并添加height:100%#main_rechts

于 2012-06-06T08:43:35.803 回答
0

#main没有固定的高度你想100%拥有什么?:) 将一些固定高度设置为#main

于 2012-06-06T08:44:46.103 回答