我有一个<div>
包含多个 child的 parent <div>
。我需要让孩子向左浮动<div>
。问题是我的父母<div>
没有正确展开,最后一个孩子<div>
低于另一个孩子<div>
。
我尝试将父<div>
css 设置为overflow:hidden; clear:both;
但它们都不起作用。
请让我知道任何可能的解决方案
CSS:
.rightpanel
{
width:80%;
float:right;
}
HTML:
<DIV id="div_rightPanel" class="rightpanel">
<DIV style="WIDTH: 100%">
<DIV style="POSITION: relative; TEXT-ALIGN: center; WIDTH: 93px; FONT-FAMILY: calibri; FLOAT: left; HEIGHT: 50px; FONT-SIZE: small" id="div_2009" class="year">
2009
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 0px" id="div_2009_2" class="quarter">Q2</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 31px" id="div_2009_3" class="quarter">Q3</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 62px" id="div_2009_4" class="quarter">Q4</DIV>
</DIV>
<DIV style="POSITION: relative; TEXT-ALIGN: center; WIDTH: 124px; FONT-FAMILY: calibri; FLOAT: left; HEIGHT: 50px; FONT-SIZE: small" id="div_2010" class="year">
2010
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 0px" id="div_2010_1" class="quarter">Q1</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 31px" id="div_2010_2" class="quarter">Q2</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 62px" id="div_2010_3" class="quarter">Q3</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 93px" id="div_2010_4" class="quarter">Q4</DIV>
</DIV>
<DIV style="POSITION: relative; TEXT-ALIGN: center; WIDTH: 124px; FONT-FAMILY: calibri; FLOAT: left; HEIGHT: 50px; FONT-SIZE: small" id="div_2011" class="year">
2011
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 0px" id="div_2011_1" class="quarter">Q1</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 31px" id="div_2011_2" class="quarter">Q2</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 62px" id="div_2011_3" class="quarter">Q3</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 93px" id="div_2011_4" class="quarter">Q4</DIV>
</DIV>
<DIV style="POSITION: relative; TEXT-ALIGN: center; WIDTH: 124px; FONT-FAMILY: calibri; FLOAT: left; HEIGHT: 50px; FONT-SIZE: small" id="div_2012" class="year">
2012
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 0px" id="div_2012_1" class="quarter">Q1</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 31px" id="div_2012_2" class="quarter">Q2</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 62px" id="div_2012_3" class="quarter">Q3</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 93px" id="div_2012_4" class="quarter">Q4</DIV>
</DIV>
<DIV style="POSITION: relative; TEXT-ALIGN: center; WIDTH: 124px; FONT-FAMILY: calibri; FLOAT: left; HEIGHT: 50px; FONT-SIZE: small" id="div_2013" class="year">
2013
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 0px" id="div_2013_1" class="quarter">Q1</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 31px" id="div_2013_2" class="quarter">Q2</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 62px" id="div_2013_3" class="quarter">Q3</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 93px" id="div_2013_4" class="quarter">Q4</DIV>
</DIV>
<DIV style="POSITION: relative; TEXT-ALIGN: center; WIDTH: 62px; FONT-FAMILY: calibri; FLOAT: left; HEIGHT: 50px; FONT-SIZE: small" id="div_2014" class="year">
2014
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 0px" id="div_2014_1" class="quarter">Q1</DIV>
<DIV style="POSITION: absolute; WIDTH: 31px; BOTTOM: 0px; FLOAT: left; HEIGHT: 25px; LEFT: 31px" id="div_2014_2" class="quarter">Q2</DIV>
</DIV>
</DIV>
</DIV> '