【发布时间】:2011-09-03 00:35:25
【问题描述】:
我现在觉得自己像个白痴。无论如何 - 该页面有三列。左右是固定宽度,必须保持不变。我需要在浏览器窗口调整大小时调整中心列的大小。我知道我知道,这应该不难,但这对我来说并没有发生。这是html:
<div class="bottom_content">
<div class="left_col">
<p>Keeping up with Commpro.Biz</p>
<div class="s_n_icons">
<img src="images/facebook.png" alt="facebook" />
<img src="images/flickr.png" alt="flickr" />
<img src="images/twitter.png" alt="twitter" />
<img src="images/youtube.png" alt="youtube" />
</div>
<p>User Name:<input ="text" size="20" name="username" value="" /></p>
<p>Password:<input ="text" size="20" name="password" value="" /></p>
<input type="button" value="submit" name="submit" />
<p><a href="#">Forgot Username or Password?</a>
<p>Click <a href="#">here</a> to sign up to receive the Commpro.Biz newsletter.</p>
<div id="twitter"></div>
</div>
<div class="center_col">
<p>What's Hot on Commpro.Biz</p>
<div class="hot_item">
hot item hot item hot item hot item hot item hot item hot itemhot item hot item
</div>
</div>
<div class="right_col">
<p>Our Partners</p>
<img src="images/BW.jpg" alt="Warren Buffett" />
<img src="images/IR_PRNewswire.gif" alt="newswire" />
<img src="images/Sysomo.gif" alt="Sysomo" />
</div>
<div id="footer">
<p>Copyright 2011 by CommproBiz</p>
</div>
</div>
和 .CSS
.left_col{
float:left;
width:190px;
height:auto;
padding-right:5px;
}
.center_col{
float:left;
width:auto;
padding:0 10px;
}
.hot_item{
width:auto;
background-color:red;
}
.hot_item a{
text-decoration:none;
}
.hot_item img{
float: right;
vertical-align: top;
}
.right_col{
float:right;
width:250px;
height:auto;
padding-left:5px;
}
.right_col img{
margin:5px;
}
发生的情况是,中心列中的内容很少,三列的行为。一旦超过一定数量的内容进入它,它就会下降到左列下方,而右列下降。
【问题讨论】: