css3:如何将高度100%放在静态/相对(无绝对定位)div上?(css3 : how to put height 100% on a static/relative (no absolute positionned) div?)
我有一个容器和2个div:1个标题(如果我添加一些行,它的高度应该是空闲的)和userList。 我希望userList具有容器的高度:任何想法如何? (没有JS解决方案,如果没有位置则更好:使用asbolute)
#container { width: 300px; height:400px; background-color: #FF0000; } #header{ background-color: #FFF500; } #userList { background-color: #00FF00; width:290px; height: 100%; overflow-y:auto; }<div id="container"> <div id="header">line1<br>line2<br>line3</div> <div id="userList"> line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br> line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br> </div> </div>I have a container and 2 divs inside: 1 header (whose height should be free if I add some lines) and an userList. I want the userList to have the height of the container : any idea how ? (no JS solution, better if no position: asbolute used)
#container { width: 300px; height:400px; background-color: #FF0000; } #header{ background-color: #FFF500; } #userList { background-color: #00FF00; width:290px; height: 100%; overflow-y:auto; }<div id="container"> <div id="header">line1<br>line2<br>line3</div> <div id="userList"> line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br> line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br>line<br> </div> </div>
更多推荐
height,userList,container,高度,JS,电脑培训,计算机培训,IT培训"/> <meta name=&qu
发布评论