我有这个容器 div,它还有 2 个子 div,我希望具有“movablebartoggleswitch”类的 div 的高度是其容器 div 的 100%,这必须在 IE8 和 chrome 中工作,但它可以在一个或另一个中工作但不是两者都有,你能告诉我有什么问题吗?
<html>
<head>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="configdiv" class="maindiv">
<div class="simpletext">
</div>
<br/>
<div name="containertoggleswitch" class="containertoggleswitch">
<div class="movablebartoggleswitch">
</div>
<div class="bartoggleswitch">
</div>
</div>
</div>
</body>
</html>
.maindiv
{
background-color:#00ABA9;
color:#FFF;
position:absolute;
width:250px;
height:500px;
font-family: 'Segoe UI';
font-weight: lighter;
font-size:20;
overflow-y:scroll;
overflow-x:hidden;
/*Works for all browsers except IE*/
overflow: -moz-scrollbars-vertical;
}
.simpletext
{
width:100%;
}
.containertoggleswitch
{
width:100px;
height:30px;
background-color:#FFF;
position:relative;
}
.bartoggleswitch
{
position :relative;
color:#000;
background-color:inherit;
height:100%;
width:100%;
border-style:solid;
border-width:5px;
border-color:#FFABAF;
}
.movablebartoggleswitch
{
clear:both;
position:absolute;
z-index:10;
width:20%;
height:100%;
background-color:#000;
float:left;
}