<div class="pro1">
<div class="icon">
<div class="buy1">
</div>
</div>
</div>
</div>
CSS:
pro{ width:960px; height:auto; margin:10px;}
pro1{ width:311px; height:auto; margin:0 0 9px 9px; text-align:center; background:url(/images/pro-bgjpg) no-repeat;}
icon{width:139px; height:139px; margin:20px 80px; float:left}
buy1{ width:137px; height:35px; margin:10px 60px; float:left;}
因为pro1高度自动的原因吧,你设置一个高度试下使用CSS中的float属性就可以了,代码如下:
<style type="text/css">
div_obj{float:left; width:300px; height:300px; margin:10px; background-color:pink;
</style>
<div class="in_one_line">
<div class="div_obj">111</div>
<div class="div_obj">222</div>
<div class="div_obj">333</div>
</div>你需要定义ID命名的div的样式,一般都用flaot浮动原理
拿你中间3个层来直接定义很简单
<div id="containerleftbar" style="flaot:left">containerleftbar
</div>
<div id="containermiddlebar" style="flaot:left">>containermiddlebar
</div>
<div id="containerrightbar" style="flaot:left">>containerrightbar
</div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 10 Transitional//EN" ">
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)