CSS div is not visible
With this css
.addProblemClass{
width:300px;
height:300px;
border:solid 1px #000000;
background-color:#FFFFFF;
opacity:0.9;/*For chrome and mozilla*/
filter:alpha(opacity=90);/*For IE*/
}
.boxHeader{
border: solid 1px #000000;
height: 15%;
}
.addProblemHeaderTextDiv{
border:solid 1px #FF0000;
margin:-1px;
width: 80%;
height: 100%;
float: left;
}
.addProblemHeaderImageDiv{
border:solid 1px #00FF00;
margin:-1px;
float: left;
width: 20%;
height: 100%;
}
b开发者_运维百科oxBody{
border:solid 1px #0000FF;
margin: -1px 0px;
height: 85%;
width: 100%;
}
and this html
<div class="addProblemClass">
<div class="boxHeader">
<div class="addProblemHeaderImageDiv"></div>//DIV A
<div class="addProblemHeaderTextDiv"></div>//DIV B
</div>
<div class="boxBody"></div>//DIV C
</div>
DIV C is not visible. Any ideas for the reason why this is hapenning? Thank you
Add a . before boxBody in css ..
.boxBody{
}
because DivC has % width and height, but as it contains nothing the percentage is a percentage of 0 which will always be 0
edit: make it a fixed width like px
or em
and it will show, or add some content into it.
精彩评论