身高:100%不工作!为什么? [英] Height: 100% doesn't work! Why?
本文介绍了身高:100%不工作!为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
CSS - 100%height does not work
有3个div,div-1是background,div-2和div-3是两个容器(一个用于文本,一个用于照片),这是我的 html代码:
< div id =div-1>
< div id =div-2>< / div>
< div id =div-3>< / div>
< / div>
CSS :
#div-1 {
width:100%;
height:100%;
padding:40px 0;
margin:0;
}
#div-2 {
width:500px;
margin:0;
float:left;
}
#div-3 {
width:200px;
margin:0;
float:right;
}
这是我得到的: p>
为什么身高:100%不起作用!MALE
谢谢!
解决方案
这可以工作
< div id =div-1>
< div id =div-2>< / div>
< div id =div-3>< / div>
< div style =clear:both>< / div>
< / div>
Possible Duplicate:
CSS - 100% height doesn’t work
I have 3 divs, the div-1 is background and div-2 and div-3 are two containers (one for text and one for photo) this is my html code:
<div id="div-1">
<div id="div-2"></div>
<div id="div-3"></div>
</div>
CSS:
#div-1 {
width: 100%;
height:100%;
padding: 40px 0;
margin:0;
}
#div-2 {
width: 500px;
margin: 0;
float: left;
}
#div-3 {
width: 200px;
margin: 0;
float: right;
}
this is what I get:
Why the Height: 100% doesn't work!?
Thanks!
解决方案
This can work
<div id="div-1">
<div id="div-2"></div>
<div id="div-3"></div>
<div style="clear:both"></div>
</div>
这篇关于身高:100%不工作!为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文